Codex TUI inserts a space for Super+Space XKB layout-switch chord

Open
#35,579 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
rust
Domain
cli

Research direction

Start with codex-rs/tui/src/bottom_pane/chat_composer.rs, then compare its modifier handling with codex-rs/tui/src/bottom_pane/textarea.rs and codex-rs/tui/src/key_hint.rs. Add or run a composer regression test for a SUPER-modified Space and verify that the Super+Space chord changes the layout without inserting text after the paste-burst timeout.

Written by the indexing model from the issue text.

Description

bug CLI TUI

Environment

  • Codex CLI: 0.145.0
  • Model: gpt-5.6-sol (the behavior occurs in local TUI input handling and appears model-independent)
  • Subscription: not disclosed; not relevant to local TUI input handling
  • Platform: Arch Linux, kernel 7.1.4-arch1-1, x86_64
  • Desktop/session: Hyprland 0.56.0, Wayland
  • Terminal: Ghostty 1.3.1-arch2, no multiplexer
  • Keyboard configuration: XKB layouts us,ru with option grp:win_space_toggle

Issue

Pressing Super+Space switches the keyboard layout as expected, but it also inserts a literal space into the Codex composer. Other terminal applications tested honor the complete Super+Space chord and do not treat it as an ordinary Space press.

Reproduction

  1. Configure XKB with layouts us,ru and option grp:win_space_toggle.
  2. Open Ghostty in a Wayland/Hyprland session.
  3. Start codex and focus the composer.
  4. Press Super+Space.
  5. Observe that the keyboard layout changes and a space appears in the composer.

Expected behavior

The keyboard layout changes and the composer remains unchanged.

Actual behavior

The keyboard layout changes and Codex inserts one literal space.

Source-level analysis

This appears to be an unintended interaction between Kitty keyboard reporting and paste-burst detection:

The same Ctrl/Alt-only condition is present on main as of 2026-07-27. I could not find an existing issue describing this behavior.

A likely regression test would send a Space character with KeyModifiers::SUPER through the composer and assert that it neither enters paste-burst handling nor inserts text after the timeout. The likely fix is to share the text-producing modifier predicate used by the text area, while preserving intended AltGr behavior.

Troubleshooting notes

  • The keymap parser currently supports Ctrl, Alt, and Shift but not Super, so /keymap does not provide a configuration workaround: https://github.com/openai/codex/blob/rust-v0.145.0/codex-rs/tui/src/keymap_setup.rs#L713-L724
  • An invocation-only diagnostic, codex -c disable_paste_burst=true, is predicted from the source path to avoid the insertion, but has not yet been independently confirmed.
  • A full codex doctor --json dump is omitted because it was run inside the Codex investigation sandbox, where proxy/network failures are expected and misleading. The relevant version, platform, session, and terminal details are included above.
Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.