Honor NO_COLOR in the terminal log handler (closes #402)
check / check (push) Successful in 15m48s
check / check (push) Successful in 15m48s
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
This commit is contained in:
1 parent
5abacbc5c1
commit
eff0763d0a
3 files changed
+50
-11
No files matched your search
@@ -836,6 +836,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/).
|
||||
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