Strip ANSI escapes from managed ComfyUI output in the log; spawn child with NO_COLOR/TERM=dumb

This commit is contained in:
mram
2026-09-21 22:29:41 +02:00
parent 5b752d5637
commit 45bc9fe27c
2 changed files with 30 additions and 3 deletions
+14
View File
@@ -239,3 +239,17 @@ func TestComfyLayoutAndDefaultCommand(t *testing.T) {
t.Errorf("missing-layout script = %s", script)
}
}
func TestStripANSI(t *testing.T) {
cases := map[string]string{
"\x1b[32m[INFO]\x1b[0m Starting server": "[INFO] Starting server",
"\x1b[1m\x1b[31m[ERROR]\x1b[0m boom": "[ERROR] boom",
"plain line": "plain line",
"\x1b[33mWARN\x1b[0m: \x1b[1mbold\x1b[0m": "WARN: bold",
}
for in, want := range cases {
if got := stripANSI(in); got != want {
t.Errorf("stripANSI(%q) = %q, want %q", in, got, want)
}
}
}