Repository navigation
Conversation
📝 WalkthroughWalkthroughTerminal snapshots now transmit alternate-screen state and scrollback ANSI length. The renderer decodes these fields and separates preserved scrollback from alternate-screen content when resolving snapshot requests. Pane restoration tests cover alternate-screen snapshots with and without preserved scrollback, including terminal escape sequences and snapshot writes. Multiplex and resynchronization tests validate metadata serialization and manual snapshot behavior. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/runtime/rpc/terminal-multiplex-escape-tail.test.ts (1)
145-158: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winMock doesn't model the "folded" payload contract, so the test can't catch a folding regression.
The mock returns
data: 'alternate frame'without thescrollbackAnsi: 'history\r\n'prefix concatenated in, yet the assertion only checks theSnapshotStartmetadata JSON (alternateScreen,scrollbackAnsiLength), not the actualSnapshotChunkpayload bytes. Contrast withremote-runtime-terminal-frame-drop-resync.test.ts'sFakeMultiplexServer.setSnapshot, which correctly setssnapshotDatato the full concatenated string ('shell history\ralternate frame') to simulate the real wire contract. If the productionserializeTerminalBufferreturn value is expected to already fold scrollback intodata(as the client-side split logic assumes), this test's mock misrepresents that contract and would not fail even if the folding step were broken. Consider aligning the mock'sdatawith the folded contract, or add an assertion against the actualSnapshotChunkpayload content.Also applies to: 248-252
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ebb33b32-381c-4f01-a698-9ab53b244465
📥 Commits
Reviewing files that changed from the base of the PR and between 94d3db4 and c7fdde21346955dd0c428bd7cc717557745087e7.
📒 Files selected for processing (5)
src/main/runtime/rpc/methods/terminal.tssrc/main/runtime/rpc/terminal-multiplex-escape-tail.test.tssrc/renderer/src/components/terminal-pane/pty-connection.test.tssrc/renderer/src/runtime/remote-runtime-terminal-frame-drop-resync.test.tssrc/renderer/src/runtime/remote-runtime-terminal-multiplexer.ts
c7fdde2 to
a76dc7b
Compare
|
Current |
Summary
dataand dropped the alt-screen metadata that the renderer restore path already uses locally.Closes #6106.
Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildFocused validation to run:
pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-multiplex-escape-tail.test.tspnpm exec vitest run --config config/vitest.config.ts src/renderer/src/runtime/remote-runtime-terminal-frame-drop-resync.test.tspnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection.test.tspnpm run typecheck:nodepnpm run typecheck:webFocused validation completed:
pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-multiplex-escape-tail.test.ts: passed,Test Files 1 passed (1),Tests 2 passed (2).pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/runtime/remote-runtime-terminal-frame-drop-resync.test.ts: passed,Test Files 1 passed (1),Tests 15 passed (15).pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection.test.ts: passed,Test Files 1 passed (1),Tests 471 passed (471).pnpm run typecheck:node: passed,tsc --noEmit -p config/tsconfig.node.json.pnpm run typecheck:web: passed,tsc --noEmit -p config/tsconfig.tc.web.json.pnpm exec oxlint src/main/runtime/rpc/methods/terminal.ts src/renderer/src/runtime/remote-runtime-terminal-multiplexer.ts src/renderer/src/components/terminal-pane/pty-connection.test.ts src/main/runtime/rpc/terminal-multiplex-escape-tail.test.ts src/renderer/src/runtime/remote-runtime-terminal-frame-drop-resync.test.ts: passed, no diagnostics.pnpm exec oxfmt --check src/main/runtime/rpc/methods/terminal.ts src/renderer/src/runtime/remote-runtime-terminal-multiplexer.ts src/renderer/src/components/terminal-pane/pty-connection.test.ts src/main/runtime/rpc/terminal-multiplex-escape-tail.test.ts src/renderer/src/runtime/remote-runtime-terminal-frame-drop-resync.test.ts: passed,All matched files use the correct format.pnpm install --frozen-lockfilecompleted successfully before validation.The generic
pnpm lint,pnpm typecheck,pnpm test, andpnpm buildcommands were not run; their template boxes remain unchecked. The targeted changed-file checks above passed.Security Audit
This change adds no new auth, filesystem, network, or command surface. It threads metadata through an existing remote terminal snapshot frame and re-splits it in the renderer transport.
Notes
Scope is limited to remote snapshot metadata parity. It does not widen into the broader visible-TUI-output work.
ELI5
Hiding and restoring a remote terminal running a full-screen TUI could drop the shell scrollback from before the TUI. Remote snapshots now carry alt-screen metadata so restore keeps that history like local does.