-
Notifications
You must be signed in to change notification settings - Fork 44
Description
When suspending the CLI with Ctrl-Z, the terminal is left in CSI-u keyboard mode. After the process is suspended, the shell receives CSI-u encoded key sequences instead of normal control characters, causing keybindings like Ctrl-E to appear as literal escape sequences.
For example, pressing Ctrl-E after suspending shows:
01;5u
instead of moving the cursor to the end of the line. This breaks normal shell interaction until the terminal keyboard mode is manually reset.
Steps to reproduce:
- Start
droid - Press
Ctrl-Zto suspend it - Back in the shell, press
Ctrl-E
Actual behavior:
The shell prints literal escape sequences:
01;5u
Expected behavior:
The shell should interpret Ctrl-E normally (move cursor to end of line).
Root cause:
The CLI enables CSI-u keyboard mode (ESC [ > 1 u) but does not disable it (ESC [ < u) when receiving SIGTSTP. Terminal keyboard mode persists after process suspension.
Workaround:
Running the following restores normal behavior:
printf '\033[<u' # send escape code
reset # reinitializes terminal
However, resuming droid leaves it in broken state, because the expected bindings do not work.
Suggested fix:
Disable CSI-u keyboard mode on suspend (SIGTSTP) and re-enable it on resume (SIGCONT).
Environment:
- Terminal: xterm-ghostty|ghostty|Ghostty
- Shell: zsh
- OS: MacOS 26.2 (25C56)
- CLI version: 0.57.17