Strip ANSI escapes from managed ComfyUI output in the log; spawn child with NO_COLOR/TERM=dumb
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user