Skip to content

After closing the OpenCode CLI, scrolling the mouse wheel and moving the mouse in the powershell will cause garbled characters. #11748

Description

@FYZAFH

Description

Image

Plugins

No Plugin

OpenCode version

1.1.48

Steps to reproduce

  1. Install opencode CLI using npm
  2. Open opencode CLI in PowerShell, and use the opencode command
  3. Ctrl-C to exit, then move the mouse in the command line, or scroll the wheel

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Powershell

Activity

  1. 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
  2. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Feb 2, 2026
  3. github-actions commented on Feb 2, 2026

    @github-actions
    Contributor

    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.

  4. cobbvanth commented on Feb 26, 2026

    @cobbvanth

    Yep I've got this issue too

  5. LuncyBloont commented on Mar 7, 2026

    @LuncyBloont

    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.

  6. FYZAFH commented on Mar 7, 2026

    @FYZAFH
    Author

    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.

  7. removed
    bugSomething isn't working
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on May 3, 2026
  8. samuel-pro-ai commented on Jun 12, 2026

    @samuel-pro-ai

    Can confirm this is still happening on v1.17.3 (latest) with WSL Ubuntu + VS Code integrated terminal.

    Reproduction:

    1. Launch opencode in VS Code's integrated terminal (default profile: Ubuntu WSL)
    2. Exit via built-in /exit command
    3. Move the mouse over the terminal
    4. 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.

  9. mmuqiitf commented on Jun 24, 2026

    @mmuqiitf

    No updates (?)

  10. emaia commented on Jul 7, 2026

    @emaia

    Same problem here (terminal spams) on v1.17.14 + wsl v2.7.10 + windows terminal. Not using vscode.

  11. XiongHaoTrigger commented on Aug 7, 2026

    @XiongHaoTrigger

    The iuess still exists in the opencode Version: 1.18.14.

    WSL version: 2.7.10.0
    Core version: 6.18.33.2-2
    WSLg version: 1.0.73.2
    MSRDC version: 1.2.6676
    Direct3D version: 1.611.1-81528511
    DXCore version: 10.0.26100.1-240331-1435.ge-release
    Windows: 10.0.26100.4349
    
    Image
  12. EvilBeaver commented on Aug 14, 2026

    @EvilBeaver

    Same on Unbuntu in ssh sessions

  13. hoegge commented on Sep 23, 2026

    @hoegge

    For me it is not the case in CMD.exe or in conemu64.exe but in Git Bash

  14. djbclark commented on Oct 2, 2026

    @djbclark

    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.

  15. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    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 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions