Enter/Backspace act twice in kitty (not in tmux; TUI2 unaffected)

Open 💬 7 comments Opened Dec 19, 2025 by kvcop
💡 Likely answer: A maintainer (fcoury, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.75.0

What subscription do you have?

Pro

Which model were you using?

_No response_

What platform is your computer?

Linux 6.14.0-37-generic x86_64 x86_64

What issue are you seeing?

  • Backspace deletes two characters.
  • Enter behaves like it was pressed twice (e.g., edit mode toggles and immediately submits).

What steps can reproduce the bug?

  1. Run codex CLI in legacy TUI (not TUI2).
  2. In kitty, press Backspace in the composer.
  3. Also reproducible with Enter: press Esc twice to edit the previous message, then press Enter to confirm - it submits immediately as if Enter was handled twice.

What is the expected behavior?

  • Backspace removes a single character.
  • Enter confirms edit or submits once.

Additional information

Summary

In the legacy TUI, some key presses (Backspace and Enter) appear to be processed twice when running inside kitty. This is not reproducible in tmux, and on the same machine TUI2 does not show the issue.

Environment

  • Terminal: kitty
  • Works correctly in tmux on the same machine.
  • TUI2 does not exhibit the issue.

Diagnostics

kitty kitten show-key shows normal codes (no obvious duplication):

Press any keys - Ctrl+D will terminate this program
UNIX    send_text
^M      \r
^?      \x7f

Notes / Hypothesis (not confirmed)

It may be related to enhanced keyboard reporting producing duplicate key events (legacy + enhanced) in kitty. Not confirmed - need assistance to identify root cause of this issue.

View original on GitHub ↗

7 Comments

tofunori · 6 months ago

I have the same issue

kvcop · 6 months ago

@tofunori for now i can suggest for you to use tmux every time you want to run codex. There's another version of tui (tui2), but developer stated that it's not ready yet

Zzzia · 5 months ago

I have the same issue with ubuntu24 + wayland, the kitty version is 0.32.2(apt repo latest version).
I tried upgrade my kitty to official latest version 0.45.0 without apt install, this problem is resolved.

fcoury contributor · 5 months ago

@kvcop @tofunori I was able to replicate the exact issue with Kitty 0.32.2:

https://github.com/user-attachments/assets/45bf653c-362a-4a67-a108-4c1d3fb44dcc

And after upgrading to 0.45 the problem no longer occurs:

https://github.com/user-attachments/assets/ae816c96-baaa-46d6-9b89-87817d433815

Can you please confirm that this works with latest Kitty and, if it does, can you please close the issue?

Otherwise feel free to let me know by replying again. Thanks!

anton-cheg · 3 months ago

Can confirm that this issue does not reproduce on kitty 0.46.2.

I was seeing similar keyboard/input anomalies (Backspace/Enter behavior) on older versions, but after upgrading to kitty 0.46.2 the problem disappeared completely in my setup.

Environment:

  • kitty 0.46.2
  • Wayland (GNOME)

Might be worth checking if this was implicitly fixed by changes in kitty’s keyboard/input handling.

dlwiii · 3 months ago

Also reproducing on Linux in Kitty with codex-cli 0.118.0.

For me, typing 12345 and pressing Backspace once deletes both 5 and 4.

Additional notes:

  • Works fine in tmux
  • Reproduces outside tmux in Kitty
  • Reproduces with codex --no-alt-screen
  • Ctrl+V then Backspace inserts a single ^? on my side, so raw Backspace input does not appear

doubled

Environment:

  • Linux Mint
  • KDE
  • Kitty
ilyyeees · 2 months ago

I was on kitty 0.32.2 (latest in the Ubuntu 24.04 apt repo) and had the exact double Enter/Backspace behavior in codex.
Upgraded to kitty 0.46.2 via the official installer:

curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin

Then linked it onto PATH ahead of the apt binary:

ln -sf ~/.local/kitty.app/bin/kitty ~/.local/kitty.app/bin/kitten ~/.local/bin/

Fully closed every kitty window, reopened, and the issue is gone. So yeah, if you're on Ubuntu/Debian apt kitty, the distro version is just too old.