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
Ctrl+C does not disable mouse tracking, causing raw escape sequences to flood terminal (Windows) #6912
When pressing Ctrl+C to interrupt/exit OpenCode on Windows, the terminal is left in mouse tracking mode. This causes raw SGR mouse tracking escape sequences to be printed to the terminal on every mouse movement, rendering the terminal unusable until manually reset.
Environment
Expected Behavior
OpenCode should cleanly exit and restore terminal to normal state, disabling mouse tracking before terminating.
Actual Behavior
Terminal remains in mouse tracking mode. Moving the mouse produces continuous output like:
[555;58;25M[555;58;26M[555;57;25M[555;57;24M[555;55;24M[555;53;23M...
This is raw SGR extended mouse tracking data (\e[;;M) being printed as text instead of being interpreted by the TUI.
Root Cause Analysis
OpenCode enables SGR extended mouse tracking (likely \e[?1003h for any-event tracking and \e[?1006h for SGR extended mode) but does not register a signal handler to disable these modes on SIGINT (Ctrl+C).
The cleanup sequence that should run on exit:
\e[?1000l # Disable normal mouse tracking
\e[?1002l # Disable button-event tracking
\e[?1003l # Disable any-event tracking
\e[?1006l # Disable SGR extended mode
Comparison
Claude Code (Anthropic's CLI) handles Ctrl+C correctly on the same system and terminal - the terminal is properly restored on exit.
Additional Context
Does not occur when using the application's built-in exit commands
Only occurs on forced interrupt via Ctrl+C
Confirmed this is not caused by oh-my-opencode plugin (purely config, no terminal handling)
This is referenced in issue #7074 comment about bun PR, which is bun problem, I also having this also, let just wait for bun to update it, or change to our beloved npm
This is referenced in issue #7074 comment about bun PR, which is bun problem, I also having this also, let just wait for bun to update it, or change to our beloved npm
This is referenced in issue #7074 comment about bun PR, which is bun problem, I also having this also, let just wait for bun to update it, or change to our beloved npm
I'm using npm
Welp I think this is related to some terminal core function, I got this error when running on Windows or WSL2, both via Windows Termnial or Alacritty but still got the error. So I just setup my old Laptop as Ubuntu, SSH to it via Windows Terminal and it worked wonderful (yes still using bun here)
It seems that this issue only happens on Git Bash. I tried using other terminals and couldn’t replicate it. I tested with PowerShell, CMD, and Zsh through Windows Terminal, and everything worked fine. So it appears to be specific to Git Bash
Activity
thomasloockx commentedon Jan 6, 2026
Here's a little video I captured when I was about to file the same bug:
wezterm-gui_PhRPhWbWhi.mp4
stefanoallima commentedon Jan 16, 2026
same here
fabioluissilva commentedon Jan 16, 2026
Also same here. I even installed Wezterm on windows. Same problem
dathtd119 commentedon Jan 16, 2026
This is referenced in issue #7074 comment about bun PR, which is bun problem, I also having this also, let just wait for bun to update it, or change to our beloved npm
fix(tui): disable mouse tracking on exit to prevent terminal corruption
kpripper commentedon Feb 1, 2026
I'm using npm
dathtd119 commentedon Feb 2, 2026
Welp I think this is related to some terminal core function, I got this error when running on Windows or WSL2, both via Windows Termnial or Alacritty but still got the error. So I just setup my old Laptop as Ubuntu, SSH to it via Windows Terminal and it worked wonderful (yes still using bun here)
Hona commentedon Feb 12, 2026
ctrl+c handling is now in as of 1.1.60
eduardozf commentedon Mar 5, 2026
Still happening on 1.2.17
Windows 11. Any terminal I tried have the same problem
Hona commentedon Mar 5, 2026
@eduardozf any plugins?
when does this happen? After /exit, ctrl+C?
can you please do a screen recording please
eduardozf commentedon Mar 5, 2026
It seems that this issue only happens on Git Bash. I tried using other terminals and couldn’t replicate it. I tested with PowerShell, CMD, and Zsh through Windows Terminal, and everything worked fine. So it appears to be specific to Git Bash
2026-03-05.20-55-55.mp4
Hona commentedon Mar 6, 2026
thanks this helps a lot!
onigetoc commentedon Apr 9, 2026
These mouse tracking in terminal are very very annoying
Hona commentedon Apr 9, 2026
what terminal are you using? what version of opencode?
this should be patched as of ages ago