Skip to content

Ghostty: exiting Codex leaves raw 0;5:3u fragment in zsh input #35443

Description

@jay-tau

What version of Codex is running?

codex-cli 0.145.0

Which model were you using?

gpt-5.6-sol max

What platform is your computer?

  • CachyOS Linux, x86_64
  • Kernel 7.1.4-1-cachyos
  • Ghostty 1.3.1-arch2.1
  • zsh 5.9.2

What issue are you seeing?

Every time I close the interactive Codex TUI and return to zsh, a raw fragment is inserted at the shell prompt:

0;5:3u

It prefixes whatever I type next. For example:

0;5:3uclaude

This resembles the visible tail of a CSI-u / Kitty enhanced-keyboard event, likely the Ctrl+D key-release encoding. Codex appears to hand the terminal back to zsh before that event is fully consumed or the keyboard mode is restored.

Steps to reproduce

  1. Open Ghostty with zsh.
  2. Run codex.
  3. Exit the Codex TUI.
  4. Start typing the next shell command.

Expected behavior

The zsh prompt receives no bytes from the Codex session, and the next command can be typed normally.

Actual behavior

The next command is prefixed with 0;5:3u on every exit.

Related reports

The earlier keyboard-reset fix in #19625 does not appear to cover this Ghostty/Linux exit path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions