Repository navigation
fix(terminal): keep desktop history when a hidden pane is revealed - #33534
Merged
Merged
Conversation
Main built its copy of a hidden pane from the renderer's xterm at the phone's 1000-row limit, and the hidden-output reveal repaints the pane from that copy, so a restored pane with more history lost all but its last 1000 rows on first reveal.
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
7 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When you reopen a terminal tab that has more than 1,000 lines of history, it sometimes keeps only the last 1,000. This change stops that.
What Changed
Before: a pane with 1,500 lines of output is put to sleep, and the app is relaunched. You then open the workspace and switch to that pane's tab. At first the pane holds all 1,500 lines; once the tab is shown, it drops to the last 1,000 rows.
After: the pane keeps its history up to the desktop depth of 5,000 rows.
Mechanism: the main process keeps a hidden copy of each terminal.
Why
The copy is what the desktop pane is repainted from, so it needs desktop depth.
Alternatives considered:
The cost is one larger buffer read per pane, on its first output only.
Linked Issue
N/A (maintainer).
Visual Proof
N/A: there's no visual change beyond the history length. The reproduction is described under Testing.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
New test
src/main/runtime/headless-hydration-desktop-depth.test.ts. It fails before the fix (1,000 rows) and passes after it (all 1,500 rows, including line 1).pnpm tc:node, oxlint and the ratchets pass, along with the hydration and terminal-multiplex suites.Reproduced on macOS from main, three runs out of three:
Review
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)