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

Ghost cursor appears at top-left (0,0) on initialization

Aperta
#122 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@midagedev ci sta già lavorando.

Dal 25/8/2026.

  • #190 di @midagedev — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Esamina l'inizializzazione di CanvasRenderer intorno a lastCursorPosition e la logica di rendering del cursore identificata vicino alle righe 1337 e 1561-1578. Riproduci il problema aprendo un Terminal con il cursore abilitato in Chrome, quindi verifica che l'inizializzazione e il successivo rendering del contenuto lascino un solo cursore nella posizione effettiva, anziché uno in (0,0).

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

Descrizione

bug status:could-not-reproduce triage:done

Description

When initializing a Terminal instance, a ghost cursor is rendered at the top-left corner (coordinates 0,0) in addition to the actual cursor position. This cursor persists and doesn't disappear even when the terminal receives content.

Steps to Reproduce

  1. Create a new Terminal instance with cursor enabled
  2. Call terminal.open(container)
  3. Observe that a cursor appears at the top-left corner (0,0)
  4. The ghost cursor remains even after terminal content is rendered

Expected Behavior

Only one cursor should be visible at the actual cursor position, not at (0,0).

Actual Behavior

Two cursors are visible:

  1. The correct cursor at the actual position
  2. A ghost cursor at the top-left corner (0,0)

Root Cause Analysis

After investigating the minified source code, the issue appears to be in CanvasRenderer:

  1. Initialization: lastCursorPosition is initialized to { x: 0, y: 0 } (around line 1337)
  2. Rendering: The cursor rendering logic at line 1561-1578 checks g === 0 && I.visible && this.cursorVisible && this.renderCursor(I.x, I.y)
  3. Problem: When the cursor moves to a new position, the old position (0,0) is not properly cleared, leaving a ghost cursor

Workaround

TBD

Environment

  • ghostty-web version: 0.4.0
  • Browser: Chrome (tested)
  • OS: macOS

Suggested Fix

The CanvasRenderer should either:

  1. Not render the cursor until a valid position is set
  2. Properly clear the initial (0,0) position when the cursor moves
  3. Initialize lastCursorPosition to a sentinel value that prevents initial rendering
Lingua principale
TypeScript
Stelle
2.9k
Fork
182
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: 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.