Summary
lib/bash/std/lib_std.sh initializes colors by checking whether stdout is a terminal, but the logging helpers write to stderr. When stdout is redirected while stderr is still attached to a terminal, log color is disabled even though the log stream can render it.
Action
- Update
__init_colors__ to check file descriptor 2 instead of file descriptor 1.
- Add focused coverage for the redirected-stdout/stderr-terminal case where practical.
- Preserve existing opt-out behavior when color is disabled explicitly.
Source
From the lib_std.sh Evolution Suggestions review item: "Color detection checks the wrong file descriptor."
Summary
lib/bash/std/lib_std.shinitializes colors by checking whether stdout is a terminal, but the logging helpers write to stderr. When stdout is redirected while stderr is still attached to a terminal, log color is disabled even though the log stream can render it.Action
__init_colors__to check file descriptor 2 instead of file descriptor 1.Source
From the
lib_std.sh Evolution Suggestionsreview item: "Color detection checks the wrong file descriptor."