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
Loss of select ability (copy/paste) shortly after it was working - VSCode #62675
Describe the bug
When running OpenCode inside the VS Code integrated terminal (over SSH), OpenCode text selection works normally at first. However, after performing a few copy-paste operations, the terminal completely loses the ability to select text. The mouse events get captured/locked by the TUI, forcing the user to either manually type reset or permanently disable mouse mode.
Expected behaviour
Native terminal text selection should remain stable and usable for sustained sessions without desynchronising or requiring a terminal reset.
Root Cause Analysis
The issue stems from an aggressive mouse capture hook within the text input framework. After a few paste operations, the interface drops focus anchors and fails to send the proper disable mouse tracking (\e[?1000l / \e[?1003l) ANSI sequences back to VS Code. This leaves the terminal permanently stuck in application mouse tracking mode, requiring the user to close and start a new session to restore the ability to even select text.
Plugins
No response
OpenCode version
opencode v2.2.6
Steps to reproduce
Steps to reproduce the behaviour:
Launch OpenCode inside the VS Code integrated terminal with mouse mode enabled.
Select and copy code blocks a few times using OpenCode mouse capture native copying
Paste elsewhere.
Attempt to select text again using standard click-and-drag.
Result: The text highlight refuses to register, as the terminal gets stuck in "application mouse tracking mode."
Thanks for the report! I think this is a duplicate of #60602, which describes the same setup and symptom: OpenCode v2 in the VS Code terminal on macOS, where selection works at first but stops highlighting anything after a few copies, and only restarting OpenCode fixes it.
Possible duplicates and closely related issues, ordered from most to least likely:
The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different. Any extra details are welcome on #60602, for example whether Option+drag (native terminal selection) still works once it gets stuck.
Thanks, that's a useful detail. Clicks on the permission prompt stop working while Enter still does, and only a new session fixes it. That looks like the same problem as the broken selection: after a while the TUI stops handling mouse input until it's restarted. It matches what's already reported in:
So I still think this is a duplicate. Please add the click symptom to #60602, so all the details are in one place. If you can, also mention whether the clicks stop working only after you've copied something, and whether Option+drag (VS Code's own selection) still works once it's stuck.
If you think this is a different problem, reply here before the bot closes this issue as a duplicate.
60602 is closed - This is an ongoing problem. Tickets get opened, people raise the bug and then you auto close them. People shouldn't have to continually come back and keep their ticket updated just to keep it alive. And it's frustrating being referred to a ticket that has been closed.
Here is another manifestation... Select/Copy works but clipboard yeilds only a portion of the content when pasted...
Shown here is OpenCode in VSCode in the background with MacOS terminal in the foreground receiving the clipboard "contents". Right after this select stopped working in VSCode OpenCode. Highlighting colours are a bit weird in the source text here. Almost looks like token highlighting.
Thanks for the extra examples, and I understand the frustration with issues being closed automatically.
#60602 is actually open again: it was reopened after its author answered the questions, and it hasn't been closed since. It's still the issue that matches your main problem: in the VS Code terminal on macOS, selection (and clicking, as you described) stops working after a while, and only restarting OpenCode brings it back. Keeping all the reports in one open issue makes the problem easier to track and fix.
The partial paste looks like a separate problem. These open issues might cover it:
If one of them matches (for example, the part that's missing was off-screen when you selected), please add a comment there. If neither does, a separate issue saying what you selected and what you got when you pasted would help. In the meantime, the messages_copy keybind (<leader>y) copies a whole message, and #55294 reports that it copies the text correctly.
If you think the main problem here is different from #60602, reply before the bot closes this issue as a duplicate.
Closing this as a duplicate of #60602, which is open and covers the same problem: in the VS Code terminal on macOS, mouse selection (and, as you saw, clicking) stops working after a while, and only restarting OpenCode fixes it. Thanks for the extra details. Please add the screenshots and the click symptom to #60602, so everything is tracked in one open issue.
For the partial pastes, #61053 (a selection can't extend past one screen) and #55294 (mouse copy drops blank lines) are the closest open issues. If neither matches, a separate issue showing what you selected and what was pasted would help.
If you think this problem is different from #60602, reply here and we can reopen it.
Activity
opencodejr commentedon Nov 8, 2026
Thanks for the report! I think this is a duplicate of #60602, which describes the same setup and symptom: OpenCode v2 in the VS Code terminal on macOS, where selection works at first but stops highlighting anything after a few copies, and only restarting OpenCode fixes it.
Possible duplicates and closely related issues, ordered from most to least likely:
The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different. Any extra details are welcome on #60602, for example whether Option+drag (native terminal selection) still works once it gets stuck.
old-square-eyes commentedon Nov 8, 2026
Another example... I can't click to accept the ask prompt VERY frequently e.g.
Hitting enter works, or restarting a new OpenCode session restores clickable acknowledgement temporarily.
opencodejr commentedon Nov 8, 2026
Thanks, that's a useful detail. Clicks on the permission prompt stop working while Enter still does, and only a new session fixes it. That looks like the same problem as the broken selection: after a while the TUI stops handling mouse input until it's restarted. It matches what's already reported in:
So I still think this is a duplicate. Please add the click symptom to #60602, so all the details are in one place. If you can, also mention whether the clicks stop working only after you've copied something, and whether Option+drag (VS Code's own selection) still works once it's stuck.
If you think this is a different problem, reply here before the bot closes this issue as a duplicate.
old-square-eyes commentedon Nov 8, 2026
60602 is closed - This is an ongoing problem. Tickets get opened, people raise the bug and then you auto close them. People shouldn't have to continually come back and keep their ticket updated just to keep it alive. And it's frustrating being referred to a ticket that has been closed.
old-square-eyes commentedon Nov 8, 2026
Here is another manifestation... Select/Copy works but clipboard yeilds only a portion of the content when pasted...
Shown here is OpenCode in VSCode in the background with MacOS terminal in the foreground receiving the clipboard "contents". Right after this select stopped working in VSCode OpenCode. Highlighting colours are a bit weird in the source text here. Almost looks like token highlighting.
opencodejr commentedon Nov 8, 2026
Thanks for the extra examples, and I understand the frustration with issues being closed automatically.
#60602 is actually open again: it was reopened after its author answered the questions, and it hasn't been closed since. It's still the issue that matches your main problem: in the VS Code terminal on macOS, selection (and clicking, as you described) stops working after a while, and only restarting OpenCode brings it back. Keeping all the reports in one open issue makes the problem easier to track and fix.
The partial paste looks like a separate problem. These open issues might cover it:
If one of them matches (for example, the part that's missing was off-screen when you selected), please add a comment there. If neither does, a separate issue saying what you selected and what you got when you pasted would help. In the meantime, the
messages_copykeybind (<leader>y) copies a whole message, and #55294 reports that it copies the text correctly.If you think the main problem here is different from #60602, reply before the bot closes this issue as a duplicate.
opencodejr commentedon Nov 9, 2026
Closing this as a duplicate of #60602, which is open and covers the same problem: in the VS Code terminal on macOS, mouse selection (and, as you saw, clicking) stops working after a while, and only restarting OpenCode fixes it. Thanks for the extra details. Please add the screenshots and the click symptom to #60602, so everything is tracked in one open issue.
For the partial pastes, #61053 (a selection can't extend past one screen) and #55294 (mouse copy drops blank lines) are the closest open issues. If neither matches, a separate issue showing what you selected and what was pasted would help.
If you think this problem is different from #60602, reply here and we can reopen it.