Repository navigation
fix(terminal-trail): stabilize sizing and session removal - #1839
Merged
FresnelR27 merged 2 commits intoSep 15, 2026
Merged
Conversation
Fit the active renderer and use live PTY dimensions to prevent stale startup geometry. Forward grid resizes without a second debounce and reconcile resizes that race native creation. Use the shared trail heading for one terminal and balance content insets. Retain dock ownership until the canonical session removal completes, with per-store duplicate-stop protection, so stopped terminals do not flash in the workstation trail. Verified 177 focused tests, full TypeScript checking, and SCSS compilation on the isolated branch. Desktop visual and CPU/RSS checks remain unrun. Pre-commit hook ran. Total eslint: 0, total circular: 5
Adapt the async close atom through a shared synchronous UI handler that catches failures. Wire both the Stop control and TerminalCore close callback to it, preserving their void-returning contracts. The complete type-aware lint gate now reports zero new findings. Verified 27 close/dock tests, 6 lint-gate tests, TypeScript, and changed-file ESLint. Pre-commit hook ran. Total eslint: 0, total circular: 5
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.
Problem
Docked terminal trails could start with mismatched shell and display dimensions, leaving zsh's inverse
%marker above the prompt. The single-terminal title used a separate chevron button and the terminal content had a 12px left inset but no right inset. Stopping a docked session released its claim before native termination removed it from the session list, briefly exposing it as a workstation trail row.Solution
Improve the terminal trail's startup, presentation, and close lifecycle as one focused change:
Potential risks
The startup code is shared by other TerminalInteractive hosts, so renderer sizing and prompt behavior in those hosts also use the corrected order. Actual Tauri GPU/font behavior, fractional display scaling, platform-specific shells, and desktop visible/hidden CPU/RSS measurements remain unverified. Screenshots/recordings were not captured because desktop computer control requires explicit user opt-in.
Stop retains the dock claim while native termination is pending; this prevents the transient handoff but means a slow native close leaves the terminal in the dock until it completes. Existing native-error cleanup behavior is unchanged. Already-written scrollback is preserved, so this does not remove old prompt artifacts.
No dependencies, shell configuration, IPC/wire schema, persistence format, or database migrations change. Reverting this commit restores the previous behavior without data migration or cleanup.
Verification
The CI follow-up fixes both
no-misused-promisesfindings at the UI close callbacks. No lint rule or baseline was changed. Follow-up verification:NODE_OPTIONS=--max-old-space-size=6144 pnpm check:typed-lint— passed, 1097 existing findings and 0 new or increased findings.pnpm test:typed-lint— 6 tests passed.pnpm exec eslint --no-eslintrc --config config/eslint.typed.cjs src/modules/shared/layouts/FocusedChatWorkstationRail/WorkstationTrailTerminal.tsx --max-warnings 0— passed.pnpm test src/store/ui/__tests__/miniTerminalAtom.test.ts src/store/workstation/codeEditor/terminal/__tests__/terminalAtoms.close.test.ts src/modules/shared/layouts/FocusedChatWorkstationRail/WorkstationTrailTerminal.test.ts— 27 tests passed after the handler change.pnpm typecheck:fastand changed-file regular ESLint — passed after the handler change.Executed on the isolated PR branch:
pnpm test src/engines/TerminalCore/components/TerminalInteractive/__tests__ src/store/ui/__tests__/miniTerminalAtom.test.ts src/store/workstation/codeEditor/terminal/__tests__/terminalAtoms.close.test.ts src/modules/shared/layouts/FocusedChatWorkstationRail/WorkstationTrailTerminal.test.ts src/modules/shared/layouts/blocks/WorkstationTrailSurface.test.ts— 18 files, 177 tests passed.pnpm typecheck:fast— passed. Earlier type failures in the shared checkout came from unrelated changes and are absent on this branch.pnpm exec sass src/engines/TerminalCore/components/TerminalInteractive/index.scss /tmp/orgii-terminal-trail.css --no-source-map— passed; the scoped right inset also passed an explicit compiled-CSS assertion.git diff --cached --name-only --diff-filter=ACMR -z | node scripts/ci/check-changed-file-length.cjs— all 6 changed production TypeScript files are within 700 lines.git diff --cached --check— passed./bin/zsh -f -ioutput from a 64-column PTY: the installed xterm parser erased it at 64 columns and retained it at 62 columns. The new delayed-startup tests exercise the corrected production boundary.Desktop visual/performance checks and the full repository test suite were not run. No Rust implementation changed.
Audit
UI audit: 1 fix, 3 kept with reason, 0 abstractions. Shared Button usage and panel labels are preserved. Lifecycle tests cover cleanup and isolation; the performance audit remains blocked on real desktop measurements and makes no CPU/RAM improvement claim.