Repository navigation
After closing the OpenCode CLI, scrolling the mouse wheel and moving the mouse in the powershell will cause garbled characters. #11748
Description
Activity
- 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 - addedopentuiThis relates to changes in v1.0, now that opencode uses opentuiThis relates to changes in v1.0, now that opencode uses opentui
on Feb 2, 2026 This issue might be a duplicate of existing issues. Please check:
- The terminal displays garbled characters. #10951: The terminal displays garbled characters (after exiting with /exit command)
- In version 1.1.23, the issue of the mouse wheel triggering abnormal ASCII codes after exiting reappeared. #8908: In version 1.1.23, the issue of the mouse wheel triggering abnormal ASCII codes after exiting reappeared (very similar symptoms with mouse wheel in PowerShell after Ctrl+C exit)
- OpenCode crashes during use on Windows (garbled console output) #10414: OpenCode crashes during use on Windows (garbled console output)
- Pressing Ctrl+C in input field outputs ANSI escape sequences/garbled text #7062: Pressing Ctrl+C in input field outputs ANSI escape sequences/garbled text
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.
Reacted by LuncyBloontYep I've got this issue too
Reacted by LuncyBloontSame. 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.
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.
- removedbugSomething isn't workingSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentuiThis relates to changes in v1.0, now that opencode uses opentui
on May 3, 2026 Can confirm this is still happening on v1.17.3 (latest) with WSL Ubuntu + VS Code integrated terminal.
Reproduction:
- Launch opencode in VS Code's integrated terminal (default profile: Ubuntu WSL)
- Exit via built-in /exit command
- Move the mouse over the terminal
- Terminal spams: 35;75;9M35;72;8M35;70;8M... continuously
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.
Reacted by EmaiaNo updates (?)
Same problem here (terminal spams) on v1.17.14 + wsl v2.7.10 + windows terminal. Not using vscode.
Same on Unbuntu in ssh sessions
For me it is not the case in CMD.exe or in conemu64.exe but in Git Bash
- marked bug: mouse escape sequences garbled after TUI exit #20458 as a duplicate of this issue
on Oct 1, 2026 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;...Mstream described here.--puredoesn'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.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Description
Plugins
No Plugin
OpenCode version
1.1.48
Steps to reproduce
opencodecommandScreenshot and/or share link
No response
Operating System
Windows 11
Terminal
Powershell