You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Redirecting the stdout of bazel causes output sent to stderr to be rendered without color. Presumably bazel is only looking at isatty(1) and not at isatty(2). For example:
$ bazel info workspaceINFO: Invocation ID: ... # INFO in green/home/zygoloid/workspace
$ bazel info workspace > /tmp/fileINFO: Invocation ID: ... # INFO *not* in green
Which category does this issue belong to?
CLI
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
$ bazel info workspace > /dev/null
Which operating system are you running Bazel on?
Linux
What is the output of bazel info release?
release 7.1.0
If bazel info release returns development version or (@non-git), tell us how you built Bazel.
No response
What's the output of git remote get-url origin; git rev-parse HEAD ?
No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
bazel doesn't appear to look at the properties of stderr if stdout is redirected. However, if I only redirect stderr, bazel does correctly determine that it's not a TTY and doesn't color the output:
$ bazel info workspace 2>>(cat)INFO: Invocation ID: ... # INFO not in green/home/zygoloid/workspace
The text was updated successfully, but these errors were encountered:
Description of the bug:
Redirecting the stdout of
bazel
causes output sent to stderr to be rendered without color. Presumablybazel
is only looking atisatty(1)
and not atisatty(2)
. For example:Which category does this issue belong to?
CLI
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Which operating system are you running Bazel on?
Linux
What is the output of
bazel info release
?release 7.1.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
bazel
doesn't appear to look at the properties of stderr if stdout is redirected. However, if I only redirect stderr,bazel
does correctly determine that it's not a TTY and doesn't color the output:The text was updated successfully, but these errors were encountered: