https://pantsbuild.org/ logo
#general
Title
# general
p

proud-dentist-22844

06/08/2021, 4:45 PM
This is odd. When I run commands with
--no-pantsd
I get colorized output (WARN or ERROR are red). But when running via
pantsd
I don't. Shouldn't it detect that I definitely have a TTY? (using
2.6.0.dev1
)
Here's a screenshot:
w

witty-crayon-22786

06/08/2021, 5:20 PM
that’s a longstanding bug, unfortunately: https://github.com/pantsbuild/pants/issues/11020 … when we run client requests in the daemon, we don’t re-detect the TTY
👍 1
well understood though, would love to fix it as a broken window
🙏 1
p

proud-dentist-22844

06/08/2021, 6:13 PM
Where does the TTY check happen in the code?
w

witty-crayon-22786

06/08/2021, 7:13 PM
the issue right now is that it happens veeery early: essentially, while the default value for the
--[no-]colors
flag is being decided. https://github.com/pantsbuild/pants/blob/af5fad7466465b71db1f9447f19918270b86e35c/src/python/pants/option/global_options.py#L533-L541
as mentioned on the ticket, we likely want to make that flag a ternary (yes, no, “auto”… or true/false/None, effectively), and then check per destination we are writing to in a few places, including here: https://github.com/pantsbuild/pants/blob/af5fad7466465b71db1f9447f19918270b86e35c/src/rust/engine/logging/src/logger.rs#L198-L199
(i’ll put this info on the ticket)
👍 1