Skip to content

Mouse Generates Garbled Text Input & Blocks User Input #3199

Description

@JuliaBonita

There is a situation when the agent is executing shell commands within an OpenCode session, then suddenly all text inputs and mouse clicks inside the OpenCode window create the garbled text that you can see in the screenshot.

During this time when the agent is interacting with a shell inside an OpenCode session, OpenCode becomes completely unusable until the agent finishes the shell interactions or I close the session and restart OpenCode completely. This always happens when the agent is interacting with a shell-based password prompt inside an OpenCode session. It seems like the password prompt in the agent's shell is somehow hijacking the OpenCode input box.

Image

Activity

  1. github-actions commented on Oct 15, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. rekram1-node commented on Oct 16, 2025

    @rekram1-node
    Collaborator

    we are currently rewriting the tui, should be able to fix these things better in the future

  3. atlasoft commented on Oct 18, 2025

    @atlasoft

    It would be really nice if tui can be as simple as a text prompt, would you consider something like "disable tui" option? I really like open code, but I also like how codename-goose handles that.

    -- sorry for the ot

  4. rekram1-node commented on Oct 18, 2025

    @rekram1-node
    Collaborator

    yeah i think we have another issue someone requested that in, we probably wont do that immediately but at some point there will most likely be a non tui version cant make any promises but ik a few other people have asked for it as well

  5. reachcreator commented on Nov 2, 2025

    @reachcreator

    I hadn't had this happen before but using the new version 1 inside Cursor today it happened for the first time. Mousing over it causes craziness.

  6. mirsella commented on Nov 3, 2025

    @mirsella
    Contributor

    is there a workaround ? Sometimes it works and sometimes not 🤷

  7. rekram1-node commented on Nov 4, 2025

    @rekram1-node
    Collaborator

    We are looking into it, you can use 0.15.31 in the meantime as a work around:

    bun x opencode-ai@0.15.31

  8. guysoft commented on Nov 11, 2025

    @guysoft

    Was this fixed? I see above 0.15.31 as a workaround, is that a downgrade or an upgrade?

  9. rekram1-node commented on Nov 11, 2025

    @rekram1-node
    Collaborator

    @guysoft what version r u on? I think it was fixed but maybe you have a setup it still happens for?

  10. mirsella commented on Nov 11, 2025

    @mirsella
    Contributor

    not happening anymore for me

  11. ltribolet commented on Dec 25, 2025

    @ltribolet

    Still happening for me:

    Image

    Platform: Windows 11
    Shell: PowerShell 7.5.4
    Opencode Version: 1.0.198

    This happens for me once I exited Opencode TUI, and even Opencode is not properly cleared up.

  12. somera commented on Dec 25, 2025

    @somera

    Windows 11
    Git Bash
    Opencode 1.0.200

    Problem still exists

  13. ltribolet commented on Dec 25, 2025

    @ltribolet

    On 1.0.201 that doesn't happen to me anymore.

  14. somera commented on Dec 25, 2025

    @somera

    Not fixed for me. I see the mouse events ...

    Windows 11
    Git Bash
    Opencode 1.0.201

  15. ltribolet commented on Dec 25, 2025

    @ltribolet

    Actually the issue arises when I exit with "ctrl+c", but not exiting with "/exit" command.

  16. somera commented on Dec 25, 2025

    @somera

    Not fixed for me. I see the mouse events ...

    Windows 11 Git Bash Opencode 1.0.201

    I'm exiting with /exit

  17. agutmanstein-scale commented on Mar 30, 2026

    @agutmanstein-scale

    @thdxr @rekram1-node Hey all. I have a genuine fix for this bug here. I see the change to just disable mouse inputs was merged though.

  18. daniel-baf commented on Aug 14, 2026

    @daniel-baf

    Reproduced this in-session behavior again on OpenCode 1.18.18 (official Linux binary), on CachyOS Linux/Wayland inside the Cursor integrated terminal (TERM=xterm-256color, TERM_PROGRAM=vscode, COLORTERM=truecolor). After the provider operation completed normally, moving the mouse filled the prompt with raw SGR movement reports such as <35;176;6M, <35;115;18M, and <35;83;23M. The TUI then appeared unresponsive as continued movement added more input, but the OpenCode process remained alive and the correlated logs had no provider, watcher, snapshot, or MCP warnings/errors.

    Mouse was not explicitly configured, so the documented mouse: true default applied. OpenCode 1.18.18 uses OpenTUI 0.4.5; with mouse enabled, modes 1000, 1002, 1003, and SGR 1006 are enabled. This looks like a recurrence of mouse input parsing/state desynchronization, potentially triggered by the Cursor/xterm.js + Wayland combination, but I have not isolated whether the fault is in OpenCode, OpenTUI, or the terminal interaction.

    Both OPENCODE_DISABLE_MOUSE=1 opencode and setting mouse: false in ~/.config/opencode/tui.json (then restarting) avoid the issue.

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