CLICOLOR_FORCE forces too much clicolor #1171

Open
opened 2026-03-29 00:48:12 +00:00 by cobaltcause · 2 comments
Member

Not sure if this is a bug or a feature request. I'm running Lix inside another program that forwards Lix's output to stdout a line-buffered way. I want to have Lix emit colors in this situation so I set CLICOLOR_FORCE=1, but for nix build at least, this causes almost all of the output to be printed... weirdly. It's as if Lix is using escape sequences to manually reposition the cursor to print each line, because it mangles the output of the program it's running as a child of. This causes such output to get buffered and then emitted almost all at once only after Lix just about finishes. The sole exception is that I'm also passing --print-out-paths in this situation, and the printed path appears normally (i.e. doesn't seem to be manually positioning the cursor).

I think that CLICOLOR_FORCE being set (perhaps in addition to other configuration/state if necessary, such as stdout/stderr not being a TTY) should cause Lix to only emit styling escape sequences (colors, bold, italic, underline, hyperlinks, reset, etc.), and not stateful escape sequences (repositioning the cursor, entering/exiting alt mode, clear, etc.) as it currently seems to.

Not sure if this is a bug or a feature request. I'm running Lix inside another program that forwards Lix's output to stdout a line-buffered way. I want to have Lix emit colors in this situation so I set `CLICOLOR_FORCE=1`, but for `nix build` at least, this causes almost all of the output to be printed... weirdly. It's as if Lix is using escape sequences to manually reposition the cursor to print each line, because it mangles the output of the program it's running as a child of. This causes such output to get buffered and then emitted almost all at once only after Lix just about finishes. The sole exception is that I'm also passing `--print-out-paths` in this situation, and the printed path appears normally (i.e. doesn't seem to be manually positioning the cursor). I think that CLICOLOR_FORCE being set (perhaps in addition to other configuration/state if necessary, such as stdout/stderr not being a TTY) should cause Lix to only emit styling escape sequences (colors, bold, italic, underline, hyperlinks, reset, etc.), and not stateful escape sequences (repositioning the cursor, entering/exiting alt mode, clear, etc.) as it currently seems to.
Owner

What --log-format is this using? The nix-command default bar-with-logs I guess?

What `--log-format` is this using? The `nix-command` default `bar-with-logs` I guess?
Author
Member

This is with Lix at 35fbfea6f8 and the full command used is, for example, nix build --no-link --print-out-paths --print-build-logs --file nix output.packages.default, and I don't have anything logging related in any nix.conf files.

This is with Lix at 35fbfea6f8649bc0ebed4896db6e06d1c0861a59 and the full command used is, for example, `nix build --no-link --print-out-paths --print-build-logs --file nix output.packages.default`, and I don't have anything logging related in any `nix.conf` files.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#1171
No description provided.