You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TUI leaves terminal in mouse-reporting/raw mode; keystrokes / mouse events print as ^[[<... after exit or crash #10610
After running opencode, my terminal sometimes ends up “stuck” in a broken state where input behaves incorrectly and mouse events / keystrokes print directly into the shell prompt (ex: ^[[<35;62;19M). This looks like the TUI enables mouse reporting / raw mode and doesn’t always restore terminal settings on exit/crash.
What happens
The TUI appears to “break” and input starts going outside of the UI.
After quitting or killing opencode, the terminal remains messed up:
Clicking/scrolling prints escape sequences like:
^[[<35;62;19M
(This matches xterm SGR mouse reporting: ESC [ < b ; x ; y M)
Shell input becomes unusable until terminal is reset.
Expected behavior
When opencode exits (even after unexpected termination), terminal settings should be restored so the shell behaves normally.
Reproduction steps
Run:
Unable to reproduce consistently. Opencode crash causes issue. I have to close the terminal to stop it.
Evidence / screenshot
After the issue triggers, the terminal prints sequences like:
^[[<35;62;19M ...
Environment
opencode version:1.1.36
node:v24.12.0
bun:1.3.6
TERM:xterm-256color
OS: Ubuntu WSL on Windows 11
Install method: bun global install
Notes / suspicion
This looks like terminal modes (raw input + mouse reporting) aren’t being cleaned up on some exit paths (crash, hang, SIGKILL, or parent/child process exit mismatch). The launcher process (node .../opencode) + native binary process might have separate lifecycle/TTY handling, leaving the terminal in mouse-reporting mode.
All of these appear to be related to the same root cause: terminal modes (mouse reporting and raw mode) not being properly cleaned up when opencode exits or crashes, particularly with process lifecycle mismatches between the launcher and native binary.
Feel free to ignore if your specific case differs from these, but they may provide additional context or workarounds.
Activity
github-actions commentedon Jan 26, 2026
This issue might be a duplicate of existing issues. Please check:
All of these appear to be related to the same root cause: terminal modes (mouse reporting and raw mode) not being properly cleaned up when opencode exits or crashes, particularly with process lifecycle mismatches between the launcher and native binary.
Feel free to ignore if your specific case differs from these, but they may provide additional context or workarounds.
orangeswim commentedon Jan 26, 2026
I've seen this happen twice now. The model I am using is GLM 4.7 on the z.ai coding plan.
orangeswim commentedon Jan 26, 2026
It looks like my issue is a duplicate of #7861 #8908 #6912