You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
scrollbackLimit is documented as lines but interpreted as bytes by WASM #140
The scrollbackLimit config option is documented and typed as a line count, but the WASM terminal internally interprets it as a byte count. This mismatch means the actual scrollback capacity is drastically smaller than expected.
Details
JS side (lib/types.ts):
exportinterfaceTerminalConfig{scrollback_limit: number;// Number of scrollback lines (default: 10,000)// ...}
The GhosttyTerminalConfig.scrollbackLimit field and Terminal constructor's scrollback option both treat this as a line count. The default is 10000, suggesting 10,000 lines of scrollback.
WASM side: Terminal.init() / Screen.init() interprets max_scrollback as bytes. 10,000 bytes is only enough for a handful of rows depending on column width and cell size, not 10,000 lines.
Impact
Users setting scrollback: 10000 (the default) get far less scrollback than expected
Measured on [email protected] (Chromium, 80x24, writing 60000 short lines and reading wasmTerm.getScrollbackLength()):
scrollback option
lines kept
100
607
2,000
607
100,000
607
1,000,000
607
10,000,000
8,027
100,000,000
59,967
So the value really is bytes (about 1.2 KB per 80-column row), there is a floor of roughly 600 rows that any smaller value collapses to, and scrollback: 1000 (the xterm.js default, and what a caller migrating from xterm.js passes) does not mean 1000 lines. Until it is converted in the library, hosts have to multiply by columns x bytes-per-cell themselves; we do that in https://github.com/erisera-code/clawser (lines * 200 columns * 16 bytes).
Activity
johnhenry commentedon Oct 10, 2026
Measured on
[email protected](Chromium, 80x24, writing 60000 short lines and readingwasmTerm.getScrollbackLength()):scrollbackoptionSo the value really is bytes (about 1.2 KB per 80-column row), there is a floor of roughly 600 rows that any smaller value collapses to, and
scrollback: 1000(the xterm.js default, and what a caller migrating from xterm.js passes) does not mean 1000 lines. Until it is converted in the library, hosts have to multiply by columns x bytes-per-cell themselves; we do that in https://github.com/erisera-code/clawser (lines * 200 columns * 16 bytes).Fix the terminal pane's stale text, focus and history
Give ghostty-web its scrollback limit in bytes