openai / openai/codex

Linux app hardcodes Ctrl+K to clear the integrated terminal, preventing shell kill-line

Open
#41,698 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug TUI
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of the Codex App are you using (From “About Codex” dialog)?

26.825.41651

What subscription do you have?

ChatGPT subscription with Codex access

What platform is your computer?

Linux 7.2.2-1-cachyos x86_64 unknown

What issue are you seeing?

In the integrated terminal on Linux, Ctrl+K never reaches the PTY. Instead, the app clears/scrolls the terminal while any foreground input continues waiting.

This breaks the standard Readline/ZLE kill-line binding (ASCII VT, 0x0b). The same shell and keybinding work normally in regular terminal applications.

The shortcut editor opened with Ctrl+/ does not contain a “Clear terminal” action, so there is no visible setting that can disable or remap this behavior.

What steps can reproduce the bug?
  1. Run the Codex desktop app on Linux.

  2. Open the integrated terminal.

  3. Run:

    read -rk1 key; printf '%02x\n' "'$key"
    
  4. Press Ctrl+K.

Observed result:

  • The terminal is cleared/scrolled.
  • The read command remains waiting, proving that 0x0b was not delivered to the PTY.
  • Searching the app's keyboard shortcuts with Ctrl+/ shows no configurable “Clear terminal” command.

For comparison, run the same command in a regular terminal and press Ctrl+K; it receives 0b.

What is the expected behavior?

When the integrated terminal is focused on Linux, Ctrl+K should be passed through to the PTY, allowing shells and terminal applications to handle it normally.

Ctrl+L can remain the terminal-clear shortcut. If Ctrl+K must remain available as an app shortcut, “Clear terminal” should at least appear in the keyboard-shortcut editor and be remappable.

Additional information

This does not reproduce on macOS: terminal clearing there uses Cmd+K, leaving Ctrl+K available to the terminal.

The problem is not caused by Wayland. The key is intercepted by the app before it reaches the PTY.

Inspection of the packaged app bundle shows a hardcoded main-process branch equivalent to:

i.terminalFocused === true && mL(event, "k")
  ? { type: "clear-active-terminal" }
  : ...

The modifier helper uses Meta on Darwin and Control elsewhere. This branch is outside the user-configurable command registry, which explains why Ctrl+/ cannot find it.

Suggested fix: restrict this shortcut to Cmd+K on Darwin, and do not intercept Ctrl+K while a terminal is focused on Linux/Windows. Alternatively, expose the action in the configurable shortcut registry.

I searched existing openai/codex issues and did not find an exact report. Issue #3049 concerns configurable TUI hotkeys, not the desktop app's integrated terminal.

Disclosure: This issue was drafted and submitted by OpenAI Codex at the reporter’s request, based on an interactive diagnosis of the installed app.

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.

Research direction

Start by reproducing the Ctrl+K behavior in the Linux integrated terminal with the provided zsh read command, then inspect the packaged app's main-process terminal-focused shortcut branch and the keyboard-shortcut registry. Done means Ctrl+K reaches the PTY on Linux while Ctrl+L still clears the terminal, with Cmd+K behavior on macOS preserved or the action exposed for remapping.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, linux, zsh
Domain
cli, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.