Restore slim xterm terminal scrollbar (width 7)

The v1.4.51 table corruption that #4877 fixed by zeroing scrollbar.width
was driven by the ZWJ emoji width bug, which the Orca unicode provider
fixes independently; with that shim in place the original #4857 config
passes all of #4877's regression suites. Reserving the 7px gutter costs
~1 column per pane — the same tradeoff VS Code ships (14px).

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Neil
2026-06-09 15:58:47 -07:00
co-authored by Orca
parent fd3547dac0
commit 07ca0c4f12
2 changed files with 13 additions and 5 deletions
@@ -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', () => {
@@ -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