Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Support --no-color #1923

Closed
pop opened this issue Apr 2, 2022 · 2 comments
Closed

Support --no-color #1923

pop opened this issue Apr 2, 2022 · 2 comments
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements

Comments

@pop
Copy link

pop commented Apr 2, 2022

Describe your feature request

Helix is great! When I use it though I'd like to be able to disable colors.
For example, when running hx --health I'd like to be able to pipe it to less without seeing color-codes.

Th option could be passed as a flag --no-color to some or all helix commands.
It can also be parsed from the environment via the NO_COLOR environment variable.

See https://no-color.org/ for more info.

I'm happy to work on this issue if somebody can point me where to start.

@pop pop added the C-enhancement Category: Improvements label Apr 2, 2022
@NNBnh
Copy link
Contributor

NNBnh commented Apr 2, 2022

Good idea! #1074 might be related.

@kirawi kirawi added the A-helix-term Area: Helix term improvements label Apr 2, 2022
@pascalkuthe
Copy link
Member

I don't think we will add support for this. Helix fundamentally needs escape sequences to work (just for render diffing alone and that will never change). We also need to set the selection (and cursors since there are multiple) to a white color too so it's visible.

So an option that fully disables all escape sequences and colors doens't make sense. The closest you can realistically get in helix is a black/white theme. That is just another theme (that you can already easily create yourself tough) and enabling it in your config (or with :theme <name >) seems reasonable and doens't need special support.

Crossterm also has hardcoded support for NO_COLOR (that we can't turn off) which completely disables emitting any colors codes. This pretty much makes helix unusable (see #8071). Since we can't turn that off upstream we can't support the environment variable even if we wanted to.

Ultimately I think NO_COLOR just doesn't make much sense for an interactive tui like Helix.

@helix-editor helix-editor locked and limited conversation to collaborators Sep 11, 2023
@pascalkuthe pascalkuthe converted this issue into discussion #8240 Sep 11, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

4 participants