GeezerVison is showing github.com — Terminal in VSCode Switches Sessions Underneath & Tab Nav Fails Clicks · Issue #67025 · anomalyco/opencode
Terminal in VSCode Switches Sessions Underneath & Tab Nav Fails Clicks #67025DescriptionDescription
1. Session switches out silently
I have a concerning issue where if I run multiple sessions like in the screenshot, the session in one or more windows switches to a completely different Opencode session. I'll come back to authorise a command and sometimes mindlessly click and realise I'm working on another session completely to the session that existed previously in the open pane.
I thought I was loosing my mind. But sometimes it's an old one I have moved on from and didn't even have open. Furthermore I usually contain certain topics in the different window locations e.g. leftmost Backend work, middle Frontend work, and Right side, quick fixes/file edits. So I notice when things scramble. I haven't found a pattern. But it's not like I have restarted the host. It quite literally switches out from underneath you. Only thing I can think of is VSCode intercepting some key combo to tab away to another Opencode session per below.
2. Can't advance to right-most tab
Per the red boxes below I can't click on the right hand side arrow > to access newer TUI tabs. Unlike the prominent mouse capture problems Opencode seems to suffer from in other Issues, click still works on visible tabs. Yet I can't get to the rightmost tab no matter what I click in this area.
Plugins
No response
OpenCode version
opencode v2.4.2
Steps to reproduce
Long coding session, multiple panes. Eventually opencode session switches out in one or more panes with a (seemingly) random one.
Screenshot
As above
Operating System
Mac OD 27.2.1 (26B131)
Terminal
VSCode Opencode extension terminal wrapper. Activityopencodejr commented on Nov 28, 2026 Thanks for the report, @old-square-eyes!
#2: can't reach the right-most tab. This looks like #66659 (newer session tabs hidden behind the right-hand overflow counter, and clicking the counter does nothing). There's an open pull request for it, #66660, which makes the counters clickable and lets you scroll the tab strip with the mouse wheel. In the meantime, the keyboard can still reach hidden tabs:
Ctrl+Tab or Alt+Down: next open session tab
Ctrl+Shift+Tab or Alt+Up: previous open session tab
#1: a pane silently switches to another session. We need a bit more information before we can try to reproduce this:
- Your OpenCode version (
opencode --version), your OS, and how you installed OpenCode.
- Your setup: is each VS Code terminal pane a separate
opencode process, or do you use one TUI with several session tabs (or both)?
- When it happens, does the pane's tab bar show the session it switched to as a tab? Was that session already open in another pane or tab?
- Anything you remember doing just before (keys pressed, clicking into the pane, switching VS Code windows), even if it seems unrelated.
You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know when you're done.
Related issues, ordered by likelihood:
opencodejr commented on Nov 29, 2026 Hi @old-square-eyes, we didn't hear back with the details we asked for, so I'm closing this issue for now.
For the pane that silently switches to another session (#1), we couldn't try to reproduce it without your OpenCode version, OS and setup: separate opencode processes per pane, or one TUI with several tabs. The tab arrow problem (#2) is tracked in #66659, and a fix is in progress in #66660.
If it happens again, replying here with those details reopens the issue.
old-square-eyes commented on Nov 29, 2026 I updated my post before your comment already. opencodejr commented on Nov 29, 2026 Thanks for adding the version and setup, @old-square-eyes. Sorry, I'd missed that you had already updated the issue.
I tried to reproduce the silent switch (#1) on v2.4.2. I ran three OpenCode TUIs side by side on one server, the same as three VS Code terminal panes each running opencode, and each pane worked in its own session. In the other panes I opened new sessions, sent prompts and closed tabs. The first pane stayed on its own session the whole time, and nothing switched without a pane being used directly.
My test was on Linux with simulated input, not macOS with VS Code's own terminal, and it was short rather than a long coding session. So the cause may be something I couldn't recreate, such as a key combination that VS Code sends to the pane. If it happens again, these details would help a lot:
- Did the session it switched to already have a tab in that pane's tab bar, or was it open in another pane?
- Had that session been closed or deleted shortly before, in any pane?
- What were you doing just before you noticed: switching focus between panes or VS Code windows, pressing Tab, Ctrl/Alt combinations, or clicking into the pane?
- Does it still happen with a single OpenCode pane, or only with several?
The tab arrow problem (#2) is tracked in #66659, and a fix is in progress in #66660.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|