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
feat: Window state persistence (persist_state) — toggle preserves buffers for instant restore #228
:Opencode toggle closes windows and deletes buffers every time. Reopening recreates the UI from scratch, re-renders all output, and loses input draft, scroll/cursor position, and focused pane.
Expected Behavior
When ui.persist_state = true (proposed default):
Hide UI windows without deleting buffers
Restore existing buffers into new split windows on next toggle
Preserve: input draft, scroll/cursor position, focused pane, input_hidden state
Respect user intent: if user clicks a line after restore, do NOT force-scroll to bottom
When ui.persist_state = false, behavior remains unchanged.
changed the title [-]Keep toggle from destroying UI buffers/windows[/-][+]Toggle should preserve buffers when keep_buffers_on_close enabled[/+]on Feb 3, 2026
changed the title [-]Toggle should preserve buffers when keep_buffers_on_close enabled[/-][+]Toggle should preserve buffers when keep_buffers_on_toggle enabled[/+]on Feb 3, 2026
changed the title [-]Toggle should preserve buffers when keep_buffers_on_toggle enabled[/-][+]feat: Window state persistence (persist_state) — toggle preserves buffers for instant restore[/+]on Feb 12, 2026
The effect achieved in the second version. If you want to try it, please use this branch. It contains a Lua test script for running benchmarks. @sudo-tee@disrupted
All based on upstream/main, independent of each other, pass all existing tests.
Key fixes
curl.is_running: job.pid persists after process exit — health check thinks SSE stream is still alive. Fixed with explicit boolean flag.
is_at_bottom cursor semantics: Old viewport-based check (line('w$')) almost always returns true in streaming chat. Changed to cursor-based check — cursor is the only reliable user-intent signal.
Phase 2 (local branch ready, PR pending)
Renderer debounce + event_manager health check + poll fix
Phase 3 (deferred)
persist_state integration — waiting for Phase 1/2 to stabilize
Reacted by Francis Belanger, Salomon Popp and Hai Ninh Hoang
Activity
[-]Keep toggle from destroying UI buffers/windows[/-][+]Toggle should preserve buffers when keep_buffers_on_close enabled[/+][-]Toggle should preserve buffers when keep_buffers_on_close enabled[/-][+]Toggle should preserve buffers when keep_buffers_on_toggle enabled[/+][-]Toggle should preserve buffers when keep_buffers_on_toggle enabled[/-][+]feat: Window state persistence (persist_state) — toggle preserves buffers for instant restore[/+]jensenojs commentedon Feb 12, 2026
The effect achieved in the second version. If you want to try it, please use this branch. It contains a Lua test script for running benchmarks. @sudo-tee @disrupted
iShot_2026-02-12_20.19.47.mp4
jensenojs commentedon Feb 12, 2026
Progress Update: PR Split Strategy
The large commit has been split into independent PRs for incremental review.
Phase 1 (PRs open)
fix/defensive-guardscurl.is_runningfixfix/window-cursor-handlingis_at_bottom()cursor semantics,buffer_valid(), cursor persistence in statefeat/reference-picker-center-configzzcentering on reference jumpAll based on
upstream/main, independent of each other, pass all existing tests.Key fixes
curl.is_running:job.pidpersists after process exit — health check thinks SSE stream is still alive. Fixed with explicit boolean flag.is_at_bottomcursor semantics: Old viewport-based check (line('w$')) almost always returns true in streaming chat. Changed to cursor-based check — cursor is the only reliable user-intent signal.Phase 2 (local branch ready, PR pending)
Phase 3 (deferred)
persist_stateintegration — waiting for Phase 1/2 to stabilize