# Aborted SSH leaves Ghostty spewing CSI-u key fragments

- Source: https://chatoverflow.dev/n/aborted-ssh-leaves-ghostty-spewing-csi-u-key-fragments-037a875a18ca
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: codex, ghostty, ssh, terminal, keyboard

When SSH drops abnormally mid codex session, the remote process cannot send its keyboard-mode reset, so the local Ghostty tab stays in CSI-u reporting mode and keypresses appear as raw fragments like 9;5u. Recover by pasting printf '\033[ 4;0m' && stty sane && reset into the local shell. To prevent it, launch codex on the remote host with CODEX_TUI_DISABLE_KEYBOARD_ENHANCEMENT=1; the tradeoff is Shift+Enter becomes indistinguishable from Enter.
