Skip to content

docs: document ITerminalOptions scrollback default#178

Merged
ThomasK33 merged 1 commit into
mainfrom
implement-issue-174
Jun 26, 2026
Merged

docs: document ITerminalOptions scrollback default#178
ThomasK33 merged 1 commit into
mainfrom
implement-issue-174

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Summary

Fixes #174.

  • Updates ITerminalOptions.scrollback docs to match the actual Terminal default of 10000 lines.
  • Adds a focused regression test that verifies default term.options.scrollback is 10000 when no options are provided.
  • Leaves runtime scrollback behavior unchanged.

Validation

  • bun test lib/terminal.test.ts -t "Public Mutable Options"
  • bun run fmt && bun run lint && bun run typecheck && bun test && bun run build

Dogfooding

  • Started the Vite dev server with bun run dev -- --host 127.0.0.1.
  • Used agent-browser to open http://127.0.0.1:8000/demo/colors-demo.html, verify the color-demo controls rendered, and capture smoke-test evidence.
  • Local evidence artifacts captured for this workspace:
    • Screenshot: /tmp/ghostty-web-174-dogfood/colors-demo.png
    • Video: /tmp/ghostty-web-174-dogfood/colors-demo.webm

Verifier summary

The adjacent issue-implementation workflow converged. Its verifier found that the final diff is limited to lib/interfaces.ts and lib/terminal.test.ts, that the public API docs now agree with the existing runtime default, and that the standard validation suite passed after generating the ignored WASM artifact required by tests.


📋 Implementation Plan

Implementation Plan — #174

Goal

Resolve GitHub issue coder/ghostty-web#174 by reconciling the public API documentation for ITerminalOptions.scrollback with the actual default used by Terminal.

The live issue is open, labeled documentation, triage:done, and accepted, and asks for the interface comment to document the actual default or for code/docs to be reconciled intentionally. The verified narrow mismatch is:

  • lib/interfaces.ts: scrollback?: number; // Default: 1000
  • lib/terminal.ts: scrollback: options.scrollback ?? 10000
  • lib/ghostty.ts: low-level WASM config fallback also uses config.scrollbackLimit ?? 10000

Scope and non-goals

In scope

  • Update the public ITerminalOptions.scrollback documentation to state the actual default: 10000.
  • Add one focused regression test asserting that a default Terminal exposes term.options.scrollback === 10000, so the documented API default is tied to executable behavior.
  • Run repository validation and collect reviewable evidence.

Out of scope

Evidence gathered

Implementation steps

Phase 1 — Pre-flight verification

  1. Confirm the working tree is clean:

    git status --short
  2. Re-read the current issue state before editing, in case labels or linked PRs changed:

    gh issue view 174 --repo coder/ghostty-web --comments
  3. Confirm the exact mismatch still exists:

    rg -n "scrollback\?: number|scrollback: options\.scrollback \?\? 10000|config\.scrollbackLimit \?\? 10000" \
      lib/interfaces.ts lib/terminal.ts lib/ghostty.ts

Quality gate: If lib/interfaces.ts already documents 10000 and no test/default mismatch remains, stop and report that the issue appears already fixed instead of creating a redundant change.

Phase 2 — Documentation correction

  1. Edit lib/interfaces.ts only at ITerminalOptions.scrollback:

    scrollback?: number; // Default: 10000
  2. Do not change neighboring options or formatting beyond formatter output.

Quality gate: Re-run the targeted grep and verify all public/API default references for this issue now agree on 10000.

Phase 3 — Focused regression test

Add one test in lib/terminal.test.ts inside the existing describe('Public Mutable Options', ...) block, next to the current test that checks custom option values.

Recommended test shape:

test('options expose default values when none are provided', async () => {
  const term = await createIsolatedTerminal();
  try {
    expect(term.options).toBeDefined();
    expect(term.options.cols).toBe(80);
    expect(term.options.rows).toBe(24);
    expect(term.options.scrollback).toBe(10000);
  } finally {
    term.dispose();
  }
});

Notes:

Quality gate: Run the targeted test before broader validation:

bun test lib/terminal.test.ts -t "Public Mutable Options"

Phase 4 — Full validation

Run the repository's standard checks before claiming success:

bun run fmt && bun run lint && bun run typecheck && bun test && bun run build

If dependencies are missing, run bun install first. If any command hangs, fails, or is blocked by environment or unrelated existing behavior, capture the exact output and document it instead of hiding it.

Phase 5 — Dogfooding and reviewable evidence

This issue has no intentional UI/runtime behavior change, so dogfooding should focus on proving the public API default and demonstrating that the demo still loads.

  1. Produce command-line evidence:

    script -q /tmp/ghostty-web-174-validation.typescript -c '
      set -e
      rg -n "scrollback\?: number|scrollback: options\.scrollback \?\? 10000" lib/interfaces.ts lib/terminal.ts
      bun test lib/terminal.test.ts -t "Public Mutable Options"
      bun run fmt && bun run lint && bun run typecheck && bun test && bun run build
    '

    Attach or summarize the resulting transcript in the PR/implementation report.

  2. Optional browser smoke evidence for reviewer confidence:

    • Start the dev server:

      bun run dev
    • Use agent-browser (load its current instructions with agent-browser skills get core first) or a normal browser to open http://localhost:8000/demo/colors-demo.html.

    • Verify the demo renders the terminal color showcase without console errors.

    • Capture a screenshot of the loaded demo and, if available, a short recording of page load/interaction.

    • Make clear in the evidence that this is a no-regression UI smoke check; the demos configure scrollback: 10000 explicitly, so this browser smoke does not prove the default behavior. The targeted unit test is the default-behavior evidence.

Acceptance criteria

  • lib/interfaces.ts documents ITerminalOptions.scrollback as defaulting to 10000.
  • lib/terminal.ts continues to default options.scrollback to 10000; no runtime behavior changes are introduced.
  • A focused test in lib/terminal.test.ts asserts the default public option value for scrollback is 10000.
  • Targeted and full validation commands pass, or any environmental blocker is documented with exact command output.
  • The final diff stays minimal and reviewable, limited to lib/interfaces.ts and the focused test addition in lib/terminal.test.ts unless formatter output requires otherwise.
  • No out-of-scope issues are fixed in this PR.

Out-of-scope issue handling during implementation

If implementation discovers another bug, flaky test, missing feature, or nice-to-have improvement:

  1. Do not expand the Document actual default for ITerminalOptions.scrollback #174 PR to fix it.

  2. Search existing issues first, including recent issues that another agent/workspace may have opened:

    gh issue list --repo coder/ghostty-web --state all --search "<root problem keywords>"
  3. If a matching issue exists, comment there with new evidence/reproduction details and link back to Document actual default for ITerminalOptions.scrollback #174 or the PR.

  4. If no matching issue exists, create a new issue with evidence, reproduction steps, expected behavior, actual behavior, why it is out of scope for Document actual default for ITerminalOptions.scrollback #174, and label it needs-triage.

  5. Return to the Document actual default for ITerminalOptions.scrollback #174 scope immediately after recording the out-of-scope finding.

PR notes for implementer

  • Keep the PR title/documentation-oriented, for example: docs: document ITerminalOptions scrollback default.
  • PR body should link Fixes #174, summarize the comment/test changes, list validation commands, and include dogfooding evidence.
  • Include the required mux-generated footer with $MUX_MODEL_STRING and $MUX_THINKING_LEVEL if creating a PR from this workspace.

Generated with mux • Model: openai:gpt-5.5 • Thinking: xhigh

Change-Id: I7277e34e9d74f8308e9942b46a755ce375e8c552
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: c94b6c9b57

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ThomasK33 ThomasK33 merged commit b6cf72a into main Jun 26, 2026
5 checks passed
@ThomasK33 ThomasK33 deleted the implement-issue-174 branch June 26, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document actual default for ITerminalOptions.scrollback

2 participants