authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-08-05 23:09:23+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-08-05 23:09:23+02:00
log7251f1a1f14afdf626e7c7f8664da423594732a3
tree1b7c1d9c98d8ed4cf62e1edf994a282f5ad98e51
parent30e471530b3e2ddf59caf309636bed940b8b3776
signature Signed by PGP key B5690EEEBB952194

Prevent terminal loading flash (#5432)


1 files changed, 5 insertions(+), 0 deletions(-)

apps/web/src/terminal/ghostty/surface.ts+5
......@@ -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