Add option to color all stderr output in red #885
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add
color_stderr
configuration option. If set totrue
, everything printed in stderr is colored as red during the.envrc
evaluation.This makes the errors much more easier to notice.
I guess that piping the stderr through
sed
with process substitution might have some issues in some complex cases. But I can't think of any, and haven't found any issues in my use cases in almost a year of ~daily use. But maybe still make the feature opt-in?It might also be more efficient to do the coloring in
direnv
, but unfortunately I'm not at the required level in Go to implement it without some guidance. And I'm not even sure it can be done there as the stdout is redirected into stderr in stdlib.Depends on #884.