Honor NO_COLOR in the terminal log handler (closes #402)
check / check (push) Successful in 10m43s
check / check (push) Successful in 10m43s
The TTY log handler always wrote ANSI color, unlike internal/ui, which disables color when NO_COLOR is set. Add a color flag to TTYHandler, set from NO_COLOR with the same test internal/ui uses, and route every color code through a paint helper that returns plain text when color is off. The README's color sentence now covers log lines too. Model: deepseek-v4-pro (implementation); opus-5-5 (rebase)
This commit is contained in:
1 parent
aae7fa17ae
commit
8dee0179d8
3 files changed
+75
-12
No files matched your search
@@ -831,7 +831,8 @@ Work planned after 1.0. Loosely ordered by priority.
|
||||
|
||||
Every command's user-facing output is governed by `internal/ui`, in one of two
|
||||
ways. Color is enabled when the stream written to is a TTY and the `NO_COLOR`
|
||||
environment variable is unset (https://no-color.org/).
|
||||
environment variable is unset (https://no-color.org/). The same rule governs the
|
||||
colorized log lines `internal/log` writes to a terminal.
|
||||
|
||||
- **Status, progress, warnings, and errors** go through the `internal/ui`
|
||||
message methods below: marker-prefixed, colored on a TTY, and — except
|
||||
|
||||
Reference in new issue
Block a user