From d7f44f48e4e7e5abe95acf6c7987e6168e556b02 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 9 Jun 2026 16:02:35 -0700 Subject: [PATCH] Restore slim terminal scrollbar (xterm width: 7) (#5051) Co-authored-by: Orca --- .../src/lib/pane-manager/pane-lifecycle.test.ts | 7 +++++-- .../src/lib/pane-manager/pane-terminal-options.ts | 11 ++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/renderer/src/lib/pane-manager/pane-lifecycle.test.ts b/src/renderer/src/lib/pane-manager/pane-lifecycle.test.ts index af6fa0c2b30..c1347f16ce8 100644 --- a/src/renderer/src/lib/pane-manager/pane-lifecycle.test.ts +++ b/src/renderer/src/lib/pane-manager/pane-lifecycle.test.ts @@ -76,8 +76,11 @@ describe('buildDefaultTerminalOptions', () => { expect(buildDefaultTerminalOptions().cursorInactiveStyle).toBe('outline') }) - it('does not reserve a classic scrollbar gutter when fitting terminal columns', () => { - expect(buildDefaultTerminalOptions().scrollbar?.width).toBe(0) + it('shows the slim xterm scrollbar in its reserved gutter', () => { + // Why: 7px gutter is an accepted ~1-column cost (VS Code reserves 14); + // the v1.4.51 table corruption that once forced width 0 was the ZWJ + // width bug, fixed separately by the Orca unicode provider. + expect(buildDefaultTerminalOptions().scrollbar?.width).toBe(7) }) it('only uses inactive outline for block cursors', () => { diff --git a/src/renderer/src/lib/pane-manager/pane-terminal-options.ts b/src/renderer/src/lib/pane-manager/pane-terminal-options.ts index 8d44391dbf9..2be964e07b1 100644 --- a/src/renderer/src/lib/pane-manager/pane-terminal-options.ts +++ b/src/renderer/src/lib/pane-manager/pane-terminal-options.ts @@ -32,9 +32,14 @@ export function buildDefaultTerminalOptions(): ITerminalOptions { macOptionClickForcesSelection: true, drawBoldTextInBrightColors: true, scrollbar: { - // Why: xterm's DOM scrollbar overlays the terminal in Electron; reserving - // gutter width in FitAddon underfits wide table/TUI output by a column. - width: 0 + // Why: slim VS Code-style scrollbar (VS Code uses 14). FitAddon reserves + // this as a gutter, costing ~1 column per pane — accepted tradeoff so the + // scrollbar never covers content (evidence in PR #5051). The v1.4.51 + // table corruption #4877 fixed by zeroing this was actually the ZWJ + // width bug; it stays fixed by pane-terminal-unicode-provider.ts. Width + // also enables the overview ruler, whose border is hidden in + // composeActiveTerminalTheme. + width: 7 }, // Why: advertise kitty keyboard protocol support so CLIs that probe // (CSI ? u) know Orca accepts enhanced key reporting. Orca still writes