Skip to content
This repository has been archived by the owner on Jan 1, 2022. It is now read-only.

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

Open
2 tasks done
epage opened this issue Dec 6, 2021 · 1 comment
Open
2 tasks done

Comments

@epage
Copy link
Owner

epage commented Dec 6, 2021

Issue by epage
Friday Oct 29, 2021 at 19:58 GMT
Originally opened as clap-rs/clap#2963


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 clap-rs/clap#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
Copy link
Owner Author

epage commented Dec 6, 2021

Comment by ctrlcctrlv
Tuesday Nov 16, 2021 at 07:53 GMT


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.

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

1 participant