Skip to content

Keep the session in the terminal's own scrollback - #55

Merged
Daxrajsinh-holboxai merged 4 commits into
mainfrom
feat/session-scrollback
Aug 10, 2026
Merged

Keep the session in the terminal's own scrollback#55
Daxrajsinh-holboxai merged 4 commits into
mainfrom
feat/session-scrollback

Conversation

@Daxrajsinh-holboxai

Copy link
Copy Markdown
Collaborator

Scrolling up showed only the shell line from before launch. The app ran on the
alternate screen, which has no scrollback, and repainted one screenful per
frame — earlier output was never written to the real buffer.

Changes

An inline viewport owns a 12-row strip at the bottom; finished output is printed
above it as ordinary terminal output. The terminal then owns the history: wheel,
selection and its own search all work, and it survives quitting.

Streaming text is pushed up a completed line at a time, so a long reply scrolls
the terminal instead of being squeezed into the strip. Only the half-written
last line stays in the viewport.

Nothing prints twice: Message.content keeps the whole reply for the wire while
display carries only the part the terminal has not had. Trimming content
would truncate what the model sees.

Completed messages print immediately rather than waiting for the turn to end —
holding them meant your prompt appeared after the answer to it, since the
answer streamed out while the prompt waited.

The fixed viewport height works because the approval prompt scrolls inside its
own box rather than growing.

Fallback

Inline viewports need a cursor-position report. If the terminal does not answer,
this falls back to the full screen and says so rather than failing to start.

Verified

Instrumented what actually reached scrollback on a pty: prompt before reply,
each paragraph inserted exactly once, no alternate screen. 353 tests; clippy
identical to main.

Bumped 0.9.5 → 0.10.0 — minor, since it changes how the app occupies your terminal.

@Daxrajsinh-holboxai
Daxrajsinh-holboxai merged commit ac9552a into main Aug 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant