codex - 💡(How to fix) Fix Backspace seems to delete more than one character, making prompting harder. [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17793Fetched 2026-04-15 06:28:09
View on GitHub
Comments
2
Participants
3
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2unlabeled ×1
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.120.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.4

What platform is your computer?

Linux 6.8.0-107-generic x86_64 x86_64

What terminal emulator and version are you using (if applicable)?

Kitty

What issue are you seeing?

Title: Codex TUI over-deletes on Backspace in Kitty on Ubuntu/X11 despite correct raw keyboard events

Environment:

  • Codex CLI: 0.120.0
  • OS: Ubuntu Linux
  • Session: X11
  • Terminal: Kitty 0.32.2
  • TERM seen by Codex: xterm-256color
  • Locale: en_US.UTF-8 / LC_ALL=en_US.UTF-8

Problem:

While typing in the interactive Codex TUI prompt, Backspace sometimes over-deletes. Example:

  1. Type hhhh
  2. Press Backspace twice
  3. Instead of deleting 2 characters, Codex often deletes all 4

I also see variants where delete does not stop immediately on key release.

Expected:

  • Two Backspace taps delete exactly two characters

Actual:

  • Two Backspace taps can delete more than two characters, sometimes the whole input

Important diagnosis:

I ruled out the keyboard, OS repeat, and Kitty input layers.

What I tested:

  • Raw keyboard events from the device were correct
  • XI2 raw X input events were correct
  • For the failing pattern, the system saw exactly:
    • 4 h key press/release pairs
    • 2 Backspace key press/release pairs
  • Backspace key release arrived promptly
  • Kitty config had no unusual input settings
  • Issue persisted after stopping Synergy
  • Issue persisted after reducing keyboard repeat from:
    • delay 500 ms / rate 33/sec
    • to delay 660 ms / rate 22/sec
  • Issue persisted when running Codex with:
    • --no-alt-screen
    • Kitty-specific env stripped (KITTY_*, TERMINFO)
    • TERM=xterm-256color

Why I believe this is a Codex TUI/input bug:

The lower layers report correct input, but Codex’s prompt editor still over-deletes. That suggests the bug is in Codex’s TUI/editor state handling or redraw/input processing, not in the keyboard, GNOME/X11, or Kitty.

Extra context:

  • synergy.service was running initially and was stopped for testing; stopping it did not fix the issue
  • Kitty version: kitty 0.32.2 created by Kovid Goyal
  • Codex version: codex-cli 0.120.0

If useful, I can provide:

  • xinput test-xi2 capture showing the exact key press/release sequence
  • system keyboard repeat settings
  • Kitty environment details

What steps can reproduce the bug?

Uploaded thread: 019d8c60-0d82-7b43-a538-cffd2fe3c96d

What is the expected behavior?

Type "hhhh" at the prompt, then press Bksp twice. Observe that all four "h" characters are deleted despite only pressing Bksp twice.

Additional information

No response

extent analysis

TL;DR

The issue is likely related to Codex TUI's input processing, and a potential fix could involve modifying the terminal settings or environment variables to improve compatibility with Kitty.

Guidance

  • Verify that the issue persists when running Codex with a different terminal emulator to isolate the problem.
  • Check the Codex documentation for any known issues or workarounds related to terminal input processing.
  • Consider setting the TERM environment variable to a different value, such as xterm, to see if it affects the behavior.
  • If possible, try running Codex with the --no-alt-screen flag and stripped Kitty-specific environment variables to minimize potential interference.

Example

No code snippet is provided as the issue seems to be related to terminal settings and environment variables rather than code.

Notes

The issue may be specific to the combination of Codex CLI, Kitty terminal, and Linux environment. Further testing and debugging may be necessary to identify the root cause.

Recommendation

Apply workaround: Try modifying the terminal settings or environment variables to improve compatibility with Kitty, as the issue seems to be related to input processing.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Backspace seems to delete more than one character, making prompting harder. [2 comments, 3 participants]