Backspace key deletes two characters at a time
Resolved 💬 14 comments Opened Aug 11, 2025 by mlovic Closed Oct 18, 2025
💡 Likely answer: A maintainer (tibo-openai, collaborator)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
0.20.0
Which model were you using?
_No response_
What platform is your computer?
Linux 6.11.0-26-generic x86_64 x86_64
What steps can reproduce the bug?
Backspace key deletes two characters instead of one. Using alacritty terminal on ubuntu. Same issue as #1800 but that one was closed. Several people engaged with that issue after closing, so it seems like this is affecting others too.
The bug happens for me on alacritty and kitty, but not on GNOME terminal.
What is the expected behavior?
_No response_
What do you see instead?
_No response_
Additional information
_No response_
14 Comments
Same here on alacritty.
It's very clear to me that in my case one char was deleted when pressed and another char was deleted when released.
Here's claude analysis after debugging with me:
Here's a summary for the GitHub issue:
---
Root Cause Identified and Fixed
The issue is caused by certain terminal emulators (Alacritty, Kitty) sending duplicate KeyEventKind::Press events for a single backspace keystroke.
Debug logging revealed that when backspace is pressed once, two Press events are received approximately 100-140ms apart.
Investigation Results:
Solution:
Added debouncing logic to ignore duplicate backspace Press events that arrive within 150ms of each other. The fix is in
tui/src/bottom_pane/chat_composer.rs:
// Debounce duplicate backspace events from certain terminals (Alacritty, Kitty)
if matches!(key_event.code, KeyCode::Backspace) {
// ... check if this is a duplicate within 150ms window
if elapsed_ms < 150 && elapsed_ms > 0 {
return (InputResult::None, false); // Ignore duplicate
}
}
This successfully prevents the double character deletion while still allowing proper backspace repeat when the key is held down (repeat events come
at ~40ms intervals when holding).
The fix has been tested and confirmed working on the affected terminals.
I don't think the problem is with alacritty because gemini and claude works normally.
More likely, it's Crossterm library that causes the problem.
Maybe, this is related: https://github.com/crossterm-rs/crossterm/issues/797#issue-1821472486
I see this in kitty.
I upgraded Alacrity to 0.15.1 and no longer have this issue.
I figured this out ---
Root cause: I had two Kitty installations.
apt) was an older build and showed the backspace-deletes-two-chars issue.~/.local/kitty.app, version 0.42.2) does not have the issue.My keyboard shortcut (and
x-terminal-emulator) launched the old system Kitty, but when I checked withkitty --versionin a shell, it reported the new user build. That mismatch made me think I was already on the latest Kitty.Fix: Point launchers/shortcuts (and
x-terminal-emulator) to the new Kitty binary, or remove the oldaptpackage so there’s only one Kitty on the system.I can confirm, updating from 0.14.0 to 0.15.1 fixed the issue for me, too. Thank you!
Updating kitty, removing apt package and installing kitty.app fixed the issue for me.
Binary Install Kitty
This should be closed since it seems to be a problem due to outdated terminal emulate versions.
updating kitty resolved the issue for me
No longer happening with kitty 0.42.2 and codex-cli 0.39.0
Closing as resolved in newer versions of term emulators and codex.
It solved my problem.