Skip to content

Commit 7251f1a

Browse files
Prevent terminal loading flash (pingdotgg#5432)
1 parent 30e4715 commit 7251f1a

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
@@ -604,6 +604,11 @@ export class GhosttyTerminalSurface {
604604

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

0 commit comments

Comments
 (0)