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

Make colored help output more compatible with an applications overall theme #2963

Closed
2 tasks done
epage opened this issue Oct 29, 2021 · 3 comments · Fixed by #4117
Closed
2 tasks done

Make colored help output more compatible with an applications overall theme #2963

epage opened this issue Oct 29, 2021 · 3 comments · Fixed by #4117
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-bug Category: Updating dependencies S-waiting-on-design Status: Waiting on user-facing design to be resolved before implementing

Comments

@epage
Copy link
Member

epage commented Oct 29, 2021

Please complete the following tasks

  • I have searched the discussions
  • I have searched the existing issues

Rust Version

rustc 1.55.0 (c8dfcfe04 2021-09-06)

Clap Version

master

Steps to reproduce the bug with the above code

Run enquirer and compare the program's regular output with its --help (after enabling colored help)

Actual Behaviour

The colors clash with the application's overall theme

Expected Behaviour

The colors are tastefully align with the rest of the theme

Additional Context

In discussing the concerns raised #2845 (see also #2906), we realized that at least one way to describe / categorize the problem with colored help is how well it meshes with the rest of an applications theme.

One of our aims is to provide a low-effort polished ("modern") experience. A subset of our target users will polish the rest of their app over time, including color support and will run into theme compatibility issues. If we can provide both a polished low-effort experience and increase our theme compatibility, that seems like an overall win for our users.

This could be solved by manual help generation (like today or with #2913) or by providing theming support (#1790) but these increase the friction for a polished experience, making it less likely for them to do so.

If we go with changing the current coloring, it doesn't mean we can't use color it has to be a lot more selective and semantically relevant, like with errors. Other tools at our disposal are dim, bold, underline, and italics.

@epage epage added C-bug Category: Updating dependencies A-help Area: documentation, including docs.rs, readme, examples, etc... labels Oct 29, 2021
@ctrlcctrlv
Copy link

If you want to guarantee better default colors regardless of a user's terminal theme, you do have the TrueColor escape codes at your disposal, as supported in modern terminals like Kitty. You can also figure out if you're in a light or dark colored terminal with the XTerm escape \e]11;?\a, supported in even older terminals.

@ctrlcctrlv
Copy link

@epage Much nicer looking now. What do you think about my theming idea? No need? Or something you'd want a PR about? I have enough TTY exp to do it for sure.

@epage
Copy link
Member Author

epage commented Aug 26, 2022

Referring to using true color?

That makes it independent of the terminal's color scheme but it doesn't make it compatible with the application's theme / branding which is what spawned this. I've also found it can cause more problems with the terminal's theme because you don't know the background color and what provides more contrast. Light/dark detection helps but I'm hesitant for including that.

This will best be experimented with on the user's side with #3234. If someone settles on something that is enough of an improvement and universal enough, then we can reconsider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-bug Category: Updating dependencies S-waiting-on-design Status: Waiting on user-facing design to be resolved before implementing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants