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
[FEATURE]: Add browser-style tab history and recovery to the TUI #48635
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Add browser-style tab history and recovery to the TUI.
Session tabs represent a working set over durable sessions. When that tab state is closed, reset, or separated from the current client state, the sessions may still exist but users lose their working layout. This can look like data loss and requires manually finding every session again.
Requested behavior:
Provide a Recently closed tabs view containing more than the single last-closed tab.
Allow restoring one tab or the complete previous tab set.
Keep recovery history across TUI restarts.
Detect recoverable tab sets after crashes, upgrades, release-channel changes, or UI-state resets.
When the TUI starts with an empty or unexpectedly reduced tab set, offer an action such as Restore 7 previous tabs.
Validate that referenced sessions still exist and avoid duplicating tabs already open.
Retain Ctrl+Shift+T as the quick shortcut for restoring the most recently closed tab.
Motivating incident:
After upgrading from the V2 beta to stable, seven open tabs disappeared from the TUI. The sessions were not deleted. Beta and stable had separate tab manifests:
~/.local/state/opencode/beta/tui/tabs.json
~/.local/state/opencode/latest/tui/tabs.json
The beta manifest still contained all seven tabs, and copying it into the stable channel restored the complete layout. This is one concrete recovery source, but the feature should work as a general tab-history mechanism rather than only as release-channel migration logic.
Other useful scenarios include accidental tab closure, forced exits, crashes, and other cases where durable sessions outlive their visible tabs.
Environment for the motivating incident:
OpenCode: beta 0.0.0-beta-19425 upgraded to stable 2.0.2
Thanks for the detailed write-up and for tracing the lost tabs to the separate beta and stable tabs.json files.
To restate the request: you'd like the TUI to keep a browser-style tab history that survives restarts. You could restore one closed tab or the whole previous set, and the TUI would offer to restore previous tabs when it starts with fewer than before (for example after a crash, an upgrade or a channel switch). It would check that the sessions still exist and skip tabs that are already open. Ctrl+Shift+T would stay as the quick reopen.
For reference, the TUI already has part of this: Ctrl+Shift+T reopens closed tabs one at a time, newest first, and the new-tab view shows a "Recently closed tabs" list of up to 10 tabs. That history is only kept in memory, though, so it is lost when the TUI restarts, and it doesn't cover tabs lost through a crash or a channel switch. That's the gap your request would close.
Maintainers will consider this. Related issues you mentioned:
Activity
github-actions commentedon Sep 12, 2026
For keybind-related issues, please also check our pinned keybinds documentation: #4997
opencodejr commentedon Oct 28, 2026
Thanks for the detailed write-up and for tracing the lost tabs to the separate beta and stable
tabs.jsonfiles.To restate the request: you'd like the TUI to keep a browser-style tab history that survives restarts. You could restore one closed tab or the whole previous set, and the TUI would offer to restore previous tabs when it starts with fewer than before (for example after a crash, an upgrade or a channel switch). It would check that the sessions still exist and skip tabs that are already open.
Ctrl+Shift+Twould stay as the quick reopen.For reference, the TUI already has part of this:
Ctrl+Shift+Treopens closed tabs one at a time, newest first, and the new-tab view shows a "Recently closed tabs" list of up to 10 tabs. That history is only kept in memory, though, so it is lost when the TUI restarts, and it doesn't cover tabs lost through a crash or a channel switch. That's the gap your request would close.Maintainers will consider this. Related issues you mentioned: