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

some way to disable bold colors? #2290

Open
oconnor663 opened this issue Jan 17, 2016 · 13 comments
Open

some way to disable bold colors? #2290

oconnor663 opened this issue Jan 17, 2016 · 13 comments
Labels
A-configuration Area: cargo config files and env vars A-console-output Area: Terminal output, colors, progress bar, etc. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-team-input Status: Needs input from team on whether/how to proceed.

Comments

@oconnor663
Copy link

I use the Solarized colorscheme in my terminal, which means that bold colors end up looking like different shades of gray. I'd like to be able to tell Cargo to use non-bold colors, or maybe be able to specify the whole palette in a config somewhere. What would be the best way to do that? I'm new to Rust, but I'm happy to try to write a PR if someone could suggest the way they'd like this to work.

@alexcrichton
Copy link
Member

Currently we don't have configuration for this (beyond turning colors off entirely), but I'd be fine adding some options to .cargo/config for this!

@retep998
Copy link
Member

I think having a configuration for which colors to use would be very useful.

@beckclib
Copy link

beckclib commented Feb 5, 2016

@alexcrichton Similar issue here, so I will no open a new one. How would one go about adding these options? Also, would you mind reminding me how to turn colours off entirely.

Thanks!

@alexcrichton
Copy link
Member

You should be able to turn colors off entirely with cargo foo --color never, and you could add this by probably changing how MultiShell is constructed/configured in Cargo itself. I'm not exactly sure what we'd want to call all the options here and how we could have them be flexible for future configuration, however.

@beckclib
Copy link

beckclib commented Feb 5, 2016

Undertood and thanks for the kind response.

@oconnor663
Copy link
Author

@beckclib I finally got around to trying this myself, but I'm very new to Rust, so by all means put up your own PR if you like.

@carols10cents carols10cents added A-configuration Area: cargo config files and env vars C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` labels Sep 25, 2017
@landersson
Copy link

+1 for being able to disable bold colours in rustc/cargo output. I like the colouring of messages, but bold text happens to be way less readable in my setup.

@ehuss ehuss added the A-console-output Area: Terminal output, colors, progress bar, etc. label Nov 23, 2019
@epage
Copy link
Contributor

epage commented Sep 20, 2023

As of #12578, cargo now has styling in multiple places. #12655 centralizes some of this and adds semantic names to it. #12627 proposes switching from termcolor to anstream which will make the styling API ansi escape codes on all platforms.

Note that cargo's styling has been duplicated into cargo fmt and soon cargo clippy. We'd need to make sure a solution works across these tools.

Related to anstream is anstyle-git and anstyle-ls which parse some user configuration formats into anstyle::Styles.

With all of that said, I don't think styling is worth it. We use basic ANSI styles which puts the user in control already by their theme choice / customization. See also clap-rs/clap#4132

@BurntSushi
Copy link
Member

I'm not sure if this is the right place for this comment, but this issue seems related and is still open.

I'm not sure when exactly, but somewhat recently, the help output of Cargo has been using a very light blue color that is extremely difficult to read on a light background. I like colors generally and so would prefer to keep them on, but it'd be nice if Cargo used a color scheme that was friendly to both light and dark backgrounds. (That is, I'm not asking that Cargo become aware of whether a light or dark background is being used.)

Here's a screenshot to show what I mean:

cargo-help

@ChrisDenton
Copy link
Member

Arguably this is an issue with your terminal's theme, but they commonly do mess up colours so maybe that's an argument for trying to workaround them.

@epage
Copy link
Contributor

epage commented Jan 10, 2024

In #12578, we picked colors based off of cargo's current color palette, assuming that if people hadn't complained before that it should be fine (and relying on the RGB values being user-controlled). We also did testing with a variety of themes to avoid problems with this.

Side note: the user-control over colors is why I prefer we stick to the basic colors not use the full 256 colors or RGB

I'm assuming that the current use of Cyan on your terminal is in minor enough spots of cargo that you've tended to overlook it?

Some options

  • Scope of problem is small enough that we decide not to address it
  • Come up with a replacement color here and elsewhere in cargo (compiler is looking at adding magenta... ;) )
  • Switch help only, maybe to a more neutral option like bold

@BurntSushi
Copy link
Member

Ah I see. The old --help output didn't show any colors at all:

cargo-help-old

So yeah, it is definitely possible that in an older version, cyan was used in different ways that didn't bug me as much.

The comment about themes makes sense. FWIW, I'm using Alacritty and I don't believe I touched the theme at all, other than maybe changing the background to be white and the foreground to be black.

I was about to then make an argument about "well if I'm using the default Alacritty colors for a light background, then maybe cyan isn't a great one to pick." But then I tried Alacritty with its default config, and only its background/foreground colors overridden: alacritty --config-file /dev/null -o 'colors.primary.background="0xffffff"' -o 'colors.primary.foreground="0x000000"'. This is what I got:

cargo-help-alacritty-new-default

Which looks quite nice. So... I should change my theme. Sorry for the noise.

@epage
Copy link
Contributor

epage commented Jan 10, 2024

The comment about themes makes sense. FWIW, I'm using Alacritty and I don't believe I touched the theme at all, other than maybe changing the background to be white and the foreground to be black.

As a light-mode user, ouch. We seem to be in the minority and it takes care to ensure things are readable (some neovim plugins and zellij are my main pain points I've not solved atm)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-configuration Area: cargo config files and env vars A-console-output Area: Terminal output, colors, progress bar, etc. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-team-input Status: Needs input from team on whether/how to proceed.
Projects
None yet
Development

No branches or pull requests

10 participants