Integrated terminal improvements
The first PR uses your chosen A presentation: Select all and Jump to latest in the existing context menu, focused scrollback shortcuts, and faster Ghostty snapshot reads.
Implemented on latest main. The focused web suite passes 100 tests, and two independent reviews found no blockers. The PostPlan copy uses fallback colors because the active host theme could not be read.
What I would add
| Priority | Improvement | Evidence and scope |
|---|---|---|
| 1 | Scrollback navigation and Select All Recommended first PR | Page/Home/End scrolling currently requires scrollbar focus. Ghostty Select All exists but has no UI caller. Add focused-terminal shortcuts and explicit local actions. Web and desktop, no server or wire changes. |
| 2 | Find in interpreted history | No search or match highlighting exists in the web adapter. Search must handle ANSI interpretation, wrapped lines, Unicode, and match-to-cell positions. A search field alone does not solve this. Larger follow-up with native mobile parity assessed separately. |
| 3 | Keep exited output and offer recovery | Web exit handling calls the close action, whose chat path deletes history. Mobile navigates away from exited sessions. An explicit exited state with a restart action would preserve diagnostics. Shared lifecycle work and a separate product decision. |
| 4 | Readable output for screen readers | The web canvas is hidden from accessibility APIs; the textarea exposes input, without readable output. Offer deliberate plain-text reading and restrained announcements. Needs screen-reader verification. |
First PR presentation options
All options provide the same navigation and selection behavior. A adds the least permanent UI.
A. Context menu, recommended
Add Select all and Jump to latest to the existing right-click menu. Keep the terminal layout intact.
B. Compact toolbar actions
Expose actions in a compact toolbar and keep the same context menu. More discoverable, but consumes terminal space.
C. Conditional latest strip
Show the strip only while scrolled up. Select All stays in the context menu. Clear position feedback, with extra scroll-state integration.
Acceptance criteria for the first PR
- Shift+PageUp and Shift+PageDown scroll history while terminal input stays focused. Explicit start/end shortcuts follow the same local behavior.
- Unmodified keys keep their terminal application behavior. Full-screen programs and IME input remain supported.
- Select All selects retained, interpreted text. Ctrl+A continues to reach the shell; use Cmd+A on macOS and Ctrl+Shift+A elsewhere, subject to the existing shortcut audit.
- Jump to latest returns to the current output. Local viewing actions also work for read-only terminal observers.
- Shortcuts and menu actions target the correct split pane. Handled keys, including release events, never reach the PTY.
- No continuously repainting animations, extra server output subscriptions, or new persistence.
Measured performance
The snapshot adapter made several WASM calls for every cell. It now uses Ghostty's official batched query and reuses a memory view that refreshes after WASM memory grows. Optional foreground and background colors keep their independent defaults.
| Output workload | Before, ms per callback | After, ms per callback | Reduction |
|---|---|---|---|
| Plain | 6.617 | 3.690 | 44% |
| ANSI | 6.327 | 3.993 | 37% |
| Unicode | 7.183 | 5.318 | 26% |
Actual production Ghostty WASM and the TypeScript adapter, Node 24.19 Linux x64. Both revisions use a 120 by 40 grid, 10,000 seeded history lines, a warmup and seven consecutive samples. Each sample appends 100 chunks and snapshots all 40 dirty rows. The medians include parsing and snapshots. Canvas, GPU, React, network and PTY costs are excluded, so these numbers do not establish end-to-end frame times or GPU savings. Clean snapshots remain around 5 microseconds.
The shared client output buffer took about 5 to 7 microseconds per append and read at its full 512 KiB limit. All probes preserved the byte limit and exact new output. This did not justify changing the buffer.
Verification and coverage
Focused selection, keyboard, optional-color, renderer and permission tests passed, 100 tests in five files. The follow-up adds a failure-path test that preserves normal key presses and releases when scrollbar metadata is unavailable; all 68 surface tests passed after that fix. Web typecheck, targeted lint and formatting checks pass. Two fresh reviewers checked the complete implementation against the pinned Ghostty ABI.
The Mac Chrome browser pass uses actual remote shell output. Select all copies first and last history lines, Shift+PageUp pages back, Cmd+Shift+Home reaches the oldest output, and Jump to latest returns to the bottom. Native Electron menu behavior, Firefox and GPU measurements remain unverified.
Web and desktop share the changed renderer. Mobile keeps its native terminal implementation. The existing terminal transport supports local, remote and tunnel connections without contract changes. Provider sign-in terminals share the keyboard implementation, including IME and alternate-screen behavior.
The final audit returned ready to file. PR #17091 is green on 9db2b55 and remains unmerged. All eight required checks pass, CodeRabbit approved, and no actionable review findings remain. Macroscope correctness passed; its automatic approvability check calls for human review because this includes both user behavior and rendering changes. The PR is ready for your review and merge decision.
The Linux browser sandbox is unavailable. Browser verification uses the authorized Mac mini. The PostPlan copy shows fallback colors because the active host theme could not be read.
Source evidence
- Scrollbar keyboard navigation and existing Ghostty Select All.
- Web terminal exit transition and close deletes history.
- Canvas and input accessibility. Search assessment includes the pinned C ABI headers and adapter methods.