-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add NIX_FORCE_COLOR env variable to skip removal of ANSI escapes #3116
Conversation
Currently the build log from a remote builder isn't colorful as usually no TTY is allocated when accessing the remote machine with SSH. However using a TTY (e.g. by setting `RequestTTY force`) doesn't work either: ``` cannot build on 'ssh://builder': serialised integer 6791531838262124011 is too large for type 'j' ``` This patch allows to skip the removal of escape sequences by adding the env var `NIX_FORCE_COLOR=1` (e.g. in `nix.envVars` in the NixOS configuration).
env vars are easy to add but also suffer from discoverability. It would be best to introduce a new command-line option for |
I don't think this is the right solution. Could you try |
AFAIK the stripping is done in the UI. I think the line
in |
@edolstra sorry for asking, but could you give me an example how to use a remote-machine with |
@Ma27 Eg: |
This works indeed perfectly fine. Closing then 👍 |
It would still be useful to have a way to force colors. For example, want to build something on CI with If I understand correctly, Lines 1409 to 1414 in 73fde9e
|
Presumably if you run inside expect and set TERM to what you prefer, things should work without changes to Nix? |
It’s, not as easy as setting an environment variable, Nix checks |
It’s, not as easy as setting an environment variable, Nix checks [`isatty(3)`](https://linux.die.net/man/3/isatty).
That's why I suggested expect (but nothing against script, either)
|
Currently the build log from a remote builder isn't colorful as usually
no TTY is allocated when accessing the remote machine with SSH. However
using a TTY (e.g. by setting
RequestTTY force
) doesn't work either:This patch allows to skip the removal of escape sequences by adding the env var
NIX_FORCE_COLOR=1
(e.g. innix.envVars
in the NixOS configuration).