Repository navigation
Mouse Generates Garbled Text Input & Blocks User Input #3199
Description
Activity
github-actions commented
on Oct 15, 2025 on Oct 15, 2025 – with GitHub ActionsContributorMore actionsThis issue might be a duplicate of existing issues. Please check:
- Terminal gets currupted when prompted for SSH key #3027: Terminal gets corrupted when prompted for SSH key - Similar symptom where UI becomes corrupted with garbled input during password/key prompts
- Weird characters appear on text input sometimes when scrolling the chat #3062: Weird characters appear on text input when scrolling - Similar garbled text input behavior
Feel free to ignore if none of these address your specific case.
we are currently rewriting the tui, should be able to fix these things better in the future
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
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
Reacted by Juan Pablo, Xavier Riu and William GeorgeI 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.
Reacted by Lucasis there a workaround ? Sometimes it works and sometimes not 🤷
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
Reacted by LucasWas this fixed? I see above 0.15.31 as a workaround, is that a downgrade or an upgrade?
@guysoft what version r u on? I think it was fixed but maybe you have a setup it still happens for?
not happening anymore for me
Windows 11
Git Bash
Opencode 1.0.200Problem still exists
On 1.0.201 that doesn't happen to me anymore.
Not fixed for me. I see the mouse events ...
Windows 11
Git Bash
Opencode 1.0.201Actually the issue arises when I exit with "ctrl+c", but not exiting with "/exit" command.
Not fixed for me. I see the mouse events ...
Windows 11 Git Bash Opencode 1.0.201
I'm exiting with
/exit@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.
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: truedefault 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 opencodeand settingmouse: falsein~/.config/opencode/tui.json(then restarting) avoid the issue.

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.