aboutsummaryrefslogtreecommitdiff
path: root/bundle/src-tauri/src/runner.rs
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-22 01:45:15 +0000
committer_ov4 <ov4@ov4.org>2026-10-22 01:45:15 +0000
commit660d618f8b0df318d636cd780e547890d0248c0c (patch)
treeea3f7746105d271558287ccd7268834245df68fd /bundle/src-tauri/src/runner.rs
parent427acc420c6fce10fa77e603f7696f3e89d342d6 (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-tauri/src/runner.rs')
-rw-r--r--bundle/src-tauri/src/runner.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/bundle/src-tauri/src/runner.rs b/bundle/src-tauri/src/runner.rs
index e2b492b..eef35d2 100644
--- a/bundle/src-tauri/src/runner.rs
+++ b/bundle/src-tauri/src/runner.rs
@@ -100,6 +100,8 @@ async fn run_process(
command
.arg(&source)
.arg("-r")
+ // Output renders stderr colors; auto would only see a pipe.
+ .arg("-fdiagnostics-color=always")
.current_dir(source.parent().ok_or("Invalid source path.")?)
.stdin(Stdio::piped())
.stdout(Stdio::piped())
@@ -193,7 +195,12 @@ mod tests {
"done\n",
0,
),
- ("OUTPUT Missing\n", "", "compilation terminated.", 1),
+ (
+ "OUTPUT Missing\n",
+ "",
+ "\u{1b}[01;31m\u{1b}[Kerror: \u{1b}[m\u{1b}[K",
+ 1,
+ ),
(
"OUTPUT 1 DIV 0\n",
"",