diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-22 01:45:15 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-22 01:45:15 +0000 |
| commit | 660d618f8b0df318d636cd780e547890d0248c0c (patch) | |
| tree | ea3f7746105d271558287ccd7268834245df68fd /bundle/src/editor.js | |
| parent | 427acc420c6fce10fa77e603f7696f3e89d342d6 (diff) | |
feat(bundle): color compiler diagnostics in Output
The runner now passes -fdiagnostics-color=always, since auto only sees a
pipe. src/ansi.js turns stderr's SGR sequences into bold and colored
runs, keeping style and cut-off sequences across chunks and dropping
other sequences such as gcc's erase-line. Program stdout stays verbatim.
Colors come from --vscode-terminal-ansi* variables. 2026 Dark leaves
them unset, so vendor/vscode/terminal-colors.json pins VS Code's dark
terminal defaults from the same upstream commit as the themes; a theme
value still wins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'bundle/src/editor.js')
| -rw-r--r-- | bundle/src/editor.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bundle/src/editor.js b/bundle/src/editor.js index 853fa82..58b0e19 100644 --- a/bundle/src/editor.js +++ b/bundle/src/editor.js @@ -33,7 +33,10 @@ export const theme = { tokenColors: [{ settings: { foreground: dark.colors['editor.foreground'], background: dark.colors['editor.background'] } }, ...dark.tokenColors] }; -for (const [key, value] of Object.entries(dark.colors)) document.documentElement.style.setProperty(`--vscode-${key.replaceAll('.', '-')}`, value); +export const themeVariable = key => `--vscode-${key.replaceAll('.', '-')}`; +// VS Code falls back to its terminal defaults when a theme leaves terminal.ansi* unset. +const colors = { ...parse(sources['../vendor/vscode/terminal-colors.json']).colors, ...dark.colors }; +for (const [key, value] of Object.entries(colors)) document.documentElement.style.setProperty(themeVariable(key), value); class TokenState { constructor(stack) { this.stack = stack; } |
