Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Renderer resizes and fully repaints every frame at a fractional devicePixelRatio (and leaves seams between cell backgrounds)

Aperta
#198 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Start in the CanvasRenderer.render() and resize() paths mentioned in the report, then reproduce the issue at a fractional devicePixelRatio such as 1.36. Verify the canvas dimensions are compared using the same integer sizing that resize() applies, and check that idle frames no longer resize or fully repaint and that coloured cell backgrounds have no visible seams.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Version: ghostty-web 0.4.0-next.20.g1858a59 (also current main, 1858a59)

What happens
With a non-integer window.devicePixelRatio (browser zoom other than 100%, a scaled display, e.g.
1.36 or 2.2), the canvas renderer calls resize() and does a full redraw on every animation
frame, about 60 times a second while nothing changes. The caret and output look "busy", and CPU
use goes up. Cell backgrounds are also drawn at fractional device-pixel edges, which leaves
hairline seams (a visible grid) over coloured backgrounds.

Cause
CanvasRenderer.render() checks

this.canvas.width !== D.cols * this.metrics.width * this.devicePixelRatio

canvas.width is always an integer and the right-hand side is fractional at a fractional DPR, so
the check is true on every frame and resize() runs again, forcing a full redraw.

Repro
Open the demo, set browser zoom to 110% (or run Chrome with --force-device-scale-factor=1.36),
then wrap term.renderer.resize to count calls: about 60/s while idle. At DPR 1 or 2: 0/s.

Fix suggestion
Compare against Math.round(cols * width * dpr) (as resize() sets it), or render at
Math.ceil(devicePixelRatio) and let the browser scale the canvas down. The second also removes
the seams. We work around it by setting renderer.devicePixelRatio = Math.ceil(window.devicePixelRatio)
after open(), re-applied on a resolution media-query change. That took idle resizes from 60/s
to 0 and removed the seams.

Lingua principale
TypeScript
Stelle
2.9k
Fork
174
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di coder/ghostty-web

Tutte le issue di coder/ghostty-web

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.