Feature: WASM terminal should respect theme palette for ANSI colors
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
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
- Pass theme palette to WASM - Allow the palette to be configured when initializing the WASM module
- Return color indices - Have WASM return ANSI color indices (0-15) rather than resolved RGB, letting the renderer resolve them
- 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di coder/ghostty-web
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
coder/ghostty-web#199 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
coder/ghostty-web#198 ·
-
attachCustomKeyEventHandler inverts xterm.js's return-value contract (silently swallows all input)Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
coder/ghostty-web#192 ·
-
A single throw inside render() permanently stops the render loop, and a consumer cannot restart itAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 65/100
coder/ghostty-web#189 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
coder/ghostty-web#188 ·
Tutte le issue di coder/ghostty-web
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
supabase/agent-skills#611 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
polka-codes/test#345 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 92/100
GoogleChromeLabs/project-sesame#217 ·
I maintainer di solito rispondono entro 12 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
solana-foundation/solana-com#2202 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100