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
After closing the OpenCode CLI, scrolling the mouse wheel and moving the mouse in the powershell will cause garbled characters. #11748
changed the title [-]After closing the OpenCode CLI, scrolling the mouse wheel and moving the mouse in the command line will cause garbled characters.[/-][+]After closing the OpenCode CLI, scrolling the mouse wheel and moving the mouse in the powershell will cause garbled characters.[/+]on Feb 2, 2026
The issue appears to be related to terminal state cleanup on Windows when exiting OpenCode, particularly with PowerShell and mouse/scroll input interactions.
Feel free to ignore if none of these address your specific case.
I originally wanted to try OpenCode, but I got stuck on this bug, which makes it completely unusable. I didn’t expect that more than a month has passed and it still hasn’t been fixed.
Same. And windows terminal is OK, but VS Code terminal can't handle mouse scroll after exit opencode. Git bash is same and push garbled characters.
The terminal becomes unusable for typing until the VS Code terminal panel is closed and reopened. reset, stty sane, and printf '\e[?1006l' all do not clear the buffered escape sequences.
Workaround: OPENCODE_DISABLE_MOUSE=1 works but kills mouse support inside the TUI.
This is a blocker for anyone using opencode inside VS Code + WSL.
Carrying over details from #20458, which was closed as a duplicate of this issue.
Environment
OS: macOS 27.0.1 (26A434)
Terminal: Ghostty 1.3.1
Shell: Bash
OpenCode: v1 (1.18.32 installed); v2.0.18 did not reproduce in the same PTY test
A macOS trigger for the same symptom. This is tracked separately in #51600. On macOS with Bash, OpenCode v1 can be stopped by job control automatically after startup: SIGTTOU (22) in the default mode and SIGTTIN (21) in attach mode. The stop skips teardown, so mouse reporting stays enabled and the shell then shows the same 35;...M stream described here. --pure doesn't prevent it. Running the TUI with Bash monitor mode temporarily disabled does.
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.
Activity
[-]After closing the OpenCode CLI, scrolling the mouse wheel and moving the mouse in the command line will cause garbled characters.[/-][+]After closing the OpenCode CLI, scrolling the mouse wheel and moving the mouse in the powershell will cause garbled characters.[/+]github-actions commentedon Feb 2, 2026
This issue might be a duplicate of existing issues. Please check:
The issue appears to be related to terminal state cleanup on Windows when exiting OpenCode, particularly with PowerShell and mouse/scroll input interactions.
Feel free to ignore if none of these address your specific case.
cobbvanth commentedon Feb 26, 2026
Yep I've got this issue too
LuncyBloont commentedon Mar 7, 2026
Same. And windows terminal is OK, but VS Code terminal can't handle mouse scroll after exit opencode. Git bash is same and push garbled characters.
FYZAFH commentedon Mar 7, 2026
I originally wanted to try OpenCode, but I got stuck on this bug, which makes it completely unusable. I didn’t expect that more than a month has passed and it still hasn’t been fixed.
samuel-pro-ai commentedon Jun 12, 2026
Can confirm this is still happening on v1.17.3 (latest) with WSL Ubuntu + VS Code integrated terminal.
Reproduction:
The terminal becomes unusable for typing until the VS Code terminal panel is closed and reopened. reset, stty sane, and printf '\e[?1006l' all do not clear the buffered escape sequences.
Workaround: OPENCODE_DISABLE_MOUSE=1 works but kills mouse support inside the TUI.
This is a blocker for anyone using opencode inside VS Code + WSL.
mmuqiitf commentedon Jun 24, 2026
No updates (?)
emaia commentedon Jul 7, 2026
Same problem here (terminal spams) on v1.17.14 + wsl v2.7.10 + windows terminal. Not using vscode.
HaoXiongDev commentedon Aug 7, 2026
The iuess still exists in the opencode Version: 1.18.14.
EvilBeaver commentedon Aug 14, 2026
Same on Unbuntu in ssh sessions
hoegge commentedon Sep 23, 2026
For me it is not the case in CMD.exe or in conemu64.exe but in Git Bash
djbclark commentedon Oct 2, 2026
Carrying over details from #20458, which was closed as a duplicate of this issue.
Environment
A macOS trigger for the same symptom. This is tracked separately in #51600. On macOS with Bash, OpenCode v1 can be stopped by job control automatically after startup: SIGTTOU (22) in the default mode and SIGTTIN (21) in attach mode. The stop skips teardown, so mouse reporting stays enabled and the shell then shows the same
35;...Mstream described here.--puredoesn't prevent it. Running the TUI with Bash monitor mode temporarily disabled does.thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊