Skip to content
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

Feature request: a simple way to opt out of all colorization #2001

Closed
telemachus opened this issue Mar 27, 2015 · 14 comments
Closed

Feature request: a simple way to opt out of all colorization #2001

telemachus opened this issue Mar 27, 2015 · 14 comments

Comments

@telemachus
Copy link

It would be great if fish supported a simple way (ideally a single environment variable) that made all of the shell's colorizations inactive.

So far as I can tell, this isn't possible at present. I would need to go through the fish_config checkerboard and select, I guess, black for all foreground and white for all background colors. (These are my shell's default colors.) I'm not even sure if that would remove all the colorizations. (I tried to run fish_config, but ended up with a bit of a mess.) In any case, that seems like a lot of work for a user who just wants the shell not to emit any extra colors. It also seems counter-productive to ask the shell itself to "set" so many things back to my terminal's default choices. It would be easier for the shell itself (i.e. eat fewer cycles) if it could simply no-op earlier in the process. (I had a conversation with someone in fish's IRC channel who suggested how this might be done, but I don't know the codebase—or C++—at all, so I'm reluctant to suggest an actual patch.)

Thanks for considering it.

@ridiculousfish
Copy link
Member

Out of curiosity, why do you want this? Do you simply not like syntax highlighting, or are you concerned about the performance impact, or another reason?

@ridiculousfish ridiculousfish added this to the fish-future milestone Mar 27, 2015
@telemachus
Copy link
Author

I'm colorblind (red/green). I have a hard time visually with the default settings in fish (some things are too light or blend into each other). And over the years, I've learned more generally that white background with black text is easiest on my eyes and most productive for me.

@ridiculousfish
Copy link
Member

Thanks for the explanation. In the next release, we're moving away from the over-complicated customize-each-color UI, and towards a "theme chooser." Here's a screenshot of what it will look like:

screen shot 2015-03-27 at 1 35 59 pm

Selected is the Mono Lace theme, which is shades of dark gray suitable for light backgrounds. Would that theme work for you, or would you prefer one which is entirely black text?

@telemachus
Copy link
Author

Selected is the Mono Lace theme, which is shades of dark gray suitable for light backgrounds. Would that theme work for you, or would you prefer one which is entirely black text?

Some thoughts:

  1. The new chooser looks much more straightforward. I think that's a great improvement.
  2. I think that the Mono Lace theme would very likely work well for me.
  3. I still think that for technical and other reasons it might be worth having a "kill switch" to turn off all color extras.

No matter what you decide, thanks for taking my request and reasons seriously. I appreciate it.

@ridiculousfish
Copy link
Member

Thank you for reporting it!

@telemachus
Copy link
Author

Last question: I realize now I closed this unintentionally. Is it better for you for me to leave it open or closed?

@ridiculousfish
Copy link
Member

Reopening.

@zanchey
Copy link
Member

zanchey commented Mar 30, 2015

Something to consider is that fish won't output colour if the underlying terminal doesn't support color. So something like env TERM=ansi-mono fish - on my system at least - results in a reasonably sensible output, except minus colors. Unfortunately it is missing a few definitions as well. You could probably fiddle with the output of infocmp and feed it in to tic to produce an appropriate terminal definition for your system.

@telemachus
Copy link
Author

@zanchey Thanks for the tip. To be frank, I wouldn't really know what to do with the output of infocmp, nor how to feed it to tic (nor what that means really). So if the output is only "reasonably sensible", I think I'll wait for a patch. Again, thanks though.

@zanchey
Copy link
Member

zanchey commented Mar 31, 2015

By reasonably sensible, I mean "I started it and it seems to work". The terminal capabilities database is what fish uses to decide whether your terminal supports color, so I think it would be reasonable to use that to turn off color support!

The short answer is that you may be able to get what you want straight away by setting your terminal emulator to use xterm-mono instead of xterm-256color or xterm as a terminal type, depending on your operating system. What OS and terminal emulator are you using?

@telemachus
Copy link
Author

@zanchey I'm on OS X, using Terminal.app. I'll give that a try in the next few days. Thanks.

@RomanHargrave
Copy link
Contributor

@telemachus
I just tested a possible solution, which the latest version of fish allows for due to a fix in the the builtin function deletion functionality. You can simply delete set_color and the redefine it as a no-op.

functions -e set_color
function set_color; end

Now, this will also break underlining, etc, via set_color, but it could be easy enough to make that noop allow for those options to pass and others by calling the builtin forcibly via builtin set_color.

Adding the ability to disable coloration natively would be pretty simple.

@ridiculousfish
Copy link
Member

Hah, that's brilliant.

@krader1961
Copy link
Contributor

Closing since there are three ways to achieve the desired result.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants