Skip to content

Commit 4dc2b90

Browse files
fix(web): prevent terminal loading flash
- Paint the themed canvas background before font and WASM initialization
1 parent de592a0 commit 4dc2b90

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎apps/web/src/terminal/ghostty/surface.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,11 @@ export class GhosttyTerminalSurface {
642642

643643
const context = canvas.getContext("2d", { alpha: false });
644644
if (!context) throw new Error("Canvas 2D is unavailable");
645+
// An opaque canvas backing store initializes to solid black, and the font
646+
// and WASM loads below leave it on screen for the whole setup window; paint
647+
// the theme background first so the mount never flashes a black box.
648+
context.fillStyle = `rgb(${options.theme.background.r}, ${options.theme.background.g}, ${options.theme.background.b})`;
649+
context.fillRect(0, 0, canvas.width, canvas.height);
645650
const fontSize = terminalFontSize(options.font?.size);
646651
try {
647652
// Cell metrics must come from the faces that will render; measuring before

0 commit comments

Comments
 (0)