What version of Codex CLI is running?
codex-cli 0.118.0
What subscription do you have?
Plus
Which model were you using?
No response
What platform is your computer?
Darwin 25.2.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
ghostty
What issue are you seeing?
After an abnormal SSH disconnect during an active Codex session in Ghostty, subsequent keypresses are inserted into the shell as raw ...u escape-sequence fragments instead of normal text input.
Example fragments I saw include:
This seems specific to Codex in my setup. I have not seen the same behavior with other similar terminal coding sessions in the same Ghostty environment.
The terminal returns to normal immediately if I copy paste and run :
printf '\033[<u\033[>4;0m' && stty sane && reset
What steps can reproduce the bug?
- Open Ghostty on macOS.
- SSH into a remote machine.
- Start an active Codex session on the remote host.
- Let the SSH connection break abnormally, for example due to network interruption / timeout / broken pipe while Codex is still running.
- Return to the local shell in the same Ghostty tab/window.
- Start typing normally.
Observed result:
keypresses are inserted as raw ...u fragments instead of normal text.
Recovery:
copy paste and run
printf '\033[<u\033[>4;0m' && stty sane && reset
What is the expected behavior?
Codex should restore terminal keyboard/input state on abnormal exit or disconnect so that the parent shell remains in a normal text-input mode.
After the SSH/Codex session breaks, typing in the local shell should continue to work normally without requiring a manual terminal reset.
Additional information
- Terminal emulator: Ghostty
- Shell: zsh
- Connection type: SSH to remote host
- Remote host : Linux 6.14.0-34-generic x86_64 x86_64
- The disconnect was not a clean exit from Codex; it happened after connection loss / timeout
- I have only observed this with Codex, not with other similar tools in the same Ghostty setup
- The fact that
printf '\033[<u\033[>4;0m' && stty sane && reset fixes it suggests terminal keyboard/input mode cleanup is being skipped on abnormal disconnect
- This may be related to enhanced keyboard reporting / CSI-u style input state being left enabled
What version of Codex CLI is running?
codex-cli 0.118.0
What subscription do you have?
Plus
Which model were you using?
No response
What platform is your computer?
Darwin 25.2.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
ghostty
What issue are you seeing?
After an abnormal SSH disconnect during an active Codex session in Ghostty, subsequent keypresses are inserted into the shell as raw
...uescape-sequence fragments instead of normal text input.Example fragments I saw include:
9;5u1:3u4;1:3uThis seems specific to Codex in my setup. I have not seen the same behavior with other similar terminal coding sessions in the same Ghostty environment.
The terminal returns to normal immediately if I copy paste and run :
What steps can reproduce the bug?
Observed result:
keypresses are inserted as raw
...ufragments instead of normal text.Recovery:
copy paste and run
What is the expected behavior?
Codex should restore terminal keyboard/input state on abnormal exit or disconnect so that the parent shell remains in a normal text-input mode.
After the SSH/Codex session breaks, typing in the local shell should continue to work normally without requiring a manual terminal reset.
Additional information
printf '\033[<u\033[>4;0m' && stty sane && resetfixes it suggests terminal keyboard/input mode cleanup is being skipped on abnormal disconnect