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

Feature: WASM terminal should respect theme palette for ANSI colors

Aperta
#121 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
typescript, wasm
Ambito
frontend, web-dev

Direzione di ricerca

Traccia come il parser WASM risolve i codici colore ANSI e come renderer.renderCell utilizza quei colori risolti, iniziando dall’inizializzazione del tema di Terminal. Confronta gli approcci proposti di passaggio della palette e di indice del colore, quindi verifica che i colori ANSI utilizzino il tema configurato invece di Tomorrow Night senza richiedere un remapping per cella.

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

Descrizione

Summary

The WASM terminal parser/renderer has a hardcoded color palette (Tomorrow Night) that doesn't respect the theme passed to the Terminal constructor. When an application sends ANSI color codes, they get resolved to Tomorrow Night RGB values regardless of the configured theme.

Current Behavior

When creating a terminal with a custom theme:

const terminal = new Terminal({
  theme: {
    background: '#002b36',  // solarized
    foreground: '#839496',
    green: '#859900',
    // ...
  }
});

The WASM parser still outputs Tomorrow Night colors (e.g., #b5bd68 for green instead of #859900), because the internal WASM module resolves ANSI codes to its built-in palette.

The renderer uses the theme for canvas background/cursor/selection, but text colors come pre-resolved from WASM.

Expected Behavior

ANSI color codes should resolve to the user's configured theme palette, not the hardcoded Tomorrow Night palette.

Workaround

We currently patch renderer.renderCell to intercept and remap colors from Tomorrow Night → custom theme using a color map. This works but requires knowing the exact Tomorrow Night palette values and adds overhead to every cell render.

Proposed Solutions

  1. Pass theme palette to WASM - Allow the palette to be configured when initializing the WASM module
  2. Return color indices - Have WASM return ANSI color indices (0-15) rather than resolved RGB, letting the renderer resolve them
  3. Document the internal palette - At minimum, document that Tomorrow Night is the hardcoded palette so consumers can build their own remapping

Option 2 would be cleanest as it separates parsing from rendering.

Environment

  • ghostty-web: 0.4.0
  • Browser: All

Filed from textual-webterm project where we encountered this while implementing theme support

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.