Skip to content

Commit d007ffb

Browse files
diegosouzapwsauyon
andauthored
docs(types): correct scrollbackLimit field documentation (#1)
scrollback_limit is passed to Ghostty's Terminal.max_scrollback, which is in bytes. The low-level GhosttyTerminalConfig / TerminalConfig docs described it as "number of scrollback lines", which is misleading — a caller passing 10,000 expecting lines gets 10,000 bytes and falls below the 2-page PageList floor. Only the low-level docstrings are corrected here. The xterm.js-compat ITerminalOptions.scrollback field still inherits xterm.js-compat framing and a misleadingly xterm.js-shaped default (1000) despite plumbing directly to a bytes-valued field; fixing that properly requires a lines-to-bytes conversion and a separate PR. Inspired-by: coder#151 Co-authored-by: Sauyon Lee <git@sjle.co>
1 parent c3115f2 commit d007ffb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ export const COLORS_STRUCT_SIZE = 12;
532532
* All color values use 0xRRGGBB format. A value of 0 means "use default".
533533
*/
534534
export interface GhosttyTerminalConfig {
535+
/** Scrollback buffer size in bytes. Passed to Terminal.max_scrollback. */
535536
scrollbackLimit?: number;
536537
fgColor?: number;
537538
bgColor?: number;
@@ -604,7 +605,7 @@ export interface Cursor {
604605
* Terminal configuration (passed to ghostty_terminal_new_with_config)
605606
*/
606607
export interface TerminalConfig {
607-
scrollback_limit: number; // Number of scrollback lines (default: 10,000)
608+
scrollback_limit: number; // Scrollback buffer size in bytes (default: 10,000)
608609
fg_color: RGB; // Default foreground color
609610
bg_color: RGB; // Default background color
610611
}

0 commit comments

Comments
 (0)