Backspace handled on both key press and key release under Sway/Wayland

Open 💬 4 comments Opened Apr 3, 2026 by Frostedmouse
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

codex-cli 0.118.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.4 medium

What platform is your computer?

Linux 6.18.7-76061807-generic x86_64 x86_64 - Pop_os, Sway

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

Alacritty & Kitty

What issue are you seeing?

Codex CLI backspaces twice under Sway/Wayland: once on key press and once on key release.

Environment:

  • Sway on Wayland
  • codex-cli 0.118.0

Reproduces in:

  • Alacritty in codex
  • Kitty in codex

Does not reproduce in:

  • Alacritty & Kitty not in codex
  • Cosmic Terminal in codex
  • Linux console
  • other applications

Observed behavior:

  • Pressing Backspace once in Codex deletes two characters
  • It appears to delete once on key press and again on key release

Notes:

  • This does not appear to be a terminal-specific config issue

because it reproduces in both Alacritty and Kitty

  • It does not happen outside Codex

What steps can reproduce the bug?

((I have not tested Alacritty or Kitty under the Cosmic desktop, only on Sway. I will update after further testing))

Running POP_os, latest with Cosmic, Install sway and change Window managers. Install either Alacritty or Kitty and Codex and launch codex inside either terminal.

What is the expected behavior?

Single backspace on key press

Additional information

_No response_

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 4 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #16306
  • #16189
  • #16121

Powered by Codex Action

etraut-openai contributor · 4 months ago

This sounds like it might be either a bug or a configuration issue with the terminal emulator you're using. You may need to do more diagnosis on your side to further narrow down the problem. Since codex is open source, you could clone it and ask codex to help you diagnose.

csmashe · 4 months ago

What version of kitty are you using. kitty --version

I had the same issue. updating kitty to 0.46.2 fixed it for me

wantianle · 2 months ago

I found a workaround for this.

In kitty, pressing Backspace once reports both press and release events via the kitty keyboard protocol:

kitten show-key -m kitty

Output:

BACKSPACE PRESS
CSI 127 u
BACKSPACE RELEASE
CSI 127 ; 1 : 3 u

Codex appears to treat both events as delete actions. Setting this hidden env var fixes it for me:

CODEX_TUI_DISABLE_KEYBOARD_ENHANCEMENT=1 codex

Persistent workaround:

export CODEX_TUI_DISABLE_KEYBOARD_ENHANCEMENT=1

Tested with Codex CLI 0.135.0, kitty 0.32.2, TERM=xterm-kitty, Ubuntu 24.04 Wayland.