Backspace deletes twice on Linux in kitty: once on key press and again on key release
What version of Codex CLI is running?
codex-cli 0.121.0
### Which model were you using?
gpt-5.4
### What platform is your computer?
Linux pop-os 6.17.9-76061709-generic x86_64
### What terminal emulator and version are you using (if applicable)?
kitty (TERM=xterm-kitty)
### What issue are you seeing?
In Codex CLI on Linux inside kitty, pressing Backspace deletes two characters instead of one.
The behavior appears to happen on both key press and key release:
- one character is removed when Backspace is pressed down
- a second character is removed when Backspace is released
This makes normal text editing unreliable in the TUI.
### What steps can reproduce the bug?
- Open
kittyon Linux. - Start
codex. - Type a short string such as
abcd. - Press Backspace once.
### What is the expected behavior?
A single Backspace keypress should delete exactly one character.
### What do you see instead?
One Backspace keypress deletes two characters.
### Additional information
Environment:
- OS: Pop!_OS / COSMIC
TERM=xterm-kittyKITTY_WINDOW_IDis set- Codex CLI version:
0.121.0
Notes:
- This does not look like key repeat from holding the key down.
- It looks like Codex may be handling both the key press event and the key release event as delete actions.
- Because this is
kitty, it may be related to Kitty Keyboard Protocol handling / key event decoding.
Potentially relevant context:
- kitty supports press/release-aware keyboard protocol events
- this may be a TUI input compatibility bug specific to
xterm-kitty/ kitty keyboard protocol handling
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I found a workaround for this.
In kitty, pressing Backspace once reports both press and release events via the kitty keyboard protocol:
Output:
Codex appears to treat both events as delete actions. Setting this hidden env var fixes it for me:
Persistent workaround:
Tested with Codex CLI 0.135.0, kitty 0.32.2, TERM=xterm-kitty, Ubuntu 24.04 Wayland.