From 12285dd0b9bf17229def8f425687a1927c80decc Mon Sep 17 00:00:00 2001 From: Sauyon Lee Date: Tue, 7 Apr 2026 03:06:41 -0700 Subject: [PATCH] Fix GhosttyTerminalConfig.scrollbackLimit docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit scrollback_limit is passed to ghostty's Terminal.max_scrollback, which is in bytes. The low-level config types 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 GhosttyTerminalConfig / TerminalConfig docs 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 in buildWasmConfig, which belongs in a separate change. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/types.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/types.ts b/lib/types.ts index 4d6eefa..390f3ae 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -532,6 +532,7 @@ export const COLORS_STRUCT_SIZE = 12; * All color values use 0xRRGGBB format. A value of 0 means "use default". */ export interface GhosttyTerminalConfig { + /** Scrollback buffer size in bytes. Passed to Terminal.max_scrollback. */ scrollbackLimit?: number; fgColor?: number; bgColor?: number; @@ -604,7 +605,7 @@ export interface Cursor { * Terminal configuration (passed to ghostty_terminal_new_with_config) */ export interface TerminalConfig { - scrollback_limit: number; // Number of scrollback lines (default: 10,000) + scrollback_limit: number; // Scrollback buffer size in bytes (default: 10,000) fg_color: RGB; // Default foreground color bg_color: RGB; // Default background color }