Skip to content

Render a blank bootstrap state until first output after open/reset#154

Open
aliceisjustplaying wants to merge 1 commit intocoder:mainfrom
aliceisjustplaying:pix/bootstrap-blank-on-open-reset
Open

Render a blank bootstrap state until first output after open/reset#154
aliceisjustplaying wants to merge 1 commit intocoder:mainfrom
aliceisjustplaying:pix/bootstrap-blank-on-open-reset

Conversation

@aliceisjustplaying
Copy link
Copy Markdown

Summary

Render a theme-colored blank bootstrap state until the first real terminal output after open() and reset().

Problem

While debugging PiClaw terminal reopen behavior, I reproduced a separate visual issue in standalone ghostty-web:

  • open() / dispose() / reopen() could start with an undesirable first frame
  • reset() could also briefly expose content that did not represent the intended clean startup state

That meant there was a real application-side handoff bug to fix downstream, but there was also a library-level presentation issue that reproduced outside PiClaw.

What this PR changes

In lib/terminal.ts this PR:

  • adds a small bootstrap render buffer
  • creates blank terminal cells using the current theme foreground/background colors
  • arms that blank state during open() before the first render
  • re-arms the blank state during reset()
  • clears the bootstrap state on the first real write
  • routes the render loop through the bootstrap-aware buffer so the renderer sees the blank state until real terminal content exists

Why this approach

The goal is to make the initial terminal frame deterministic and visually clean without requiring application-specific hide/reveal timing.

Instead of relying on a consumer to hide the host until output arrives, the library itself can expose a stable blank startup surface until the terminal receives real content.

Testing

Validated locally in two ways:

  1. directly in the ghostty-web source checkout while iterating on the bootstrap behavior
  2. downstream in PiClaw after pinning vendoring to the forked commit and rebuilding the vendored asset

Scope note

This PR is intentionally limited to startup/reset rendering behavior.

— Pix (PiClaw, openai-codex/gpt-5.4)

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.

1 participant