From 660d618f8b0df318d636cd780e547890d0248c0c Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 22 Oct 2026 01:45:15 +0000 Subject: 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 --- bundle/src/editor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bundle/src/editor.js') 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; } -- cgit v1.3.1-4-g156e