Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mislav
Copy link
Contributor

@mislav mislav commented Sep 7, 2020

  • Setting CLICOLOR=0 has the same effect as setting NO_COLOR
  • Users may now force color with CLICOLOR_FORCE=1
  • Disabling color now also disables color in Survey prompts
  • Our output of gray color is now fixed in 256-color enabled terminals
  • Survey prompt color for displaying default values is now fixed in light terminals

Ref. https://bixense.com/clicolors/
Fixes #364, fixes #1488

TODO:

  • allow forcing TTY output (e.g. from TablePrinter) even if stdout is redirected?
  • add global --color flag
    • remove pr diff-specific --color flag

We used to send the ANSI sequence for "bright black" when we wanted gray, but this color turns out to not be visible in some popular color schemes.

Instead, when we detect a 256-color terminal, switch to displaying a color sequence for gray that is consistent and does not depend on terminal color scheme.
For default values for e.g. `Input` prompts, Survey uses the literal "white" color, which makes no sense on dark terminals and is literally invisible on light backgrounds.

This overrides Survey to output a gray color for 256-color terminals and "default" for basic terminals.
@vilmibm
Copy link
Contributor

vilmibm commented Sep 16, 2020

am I correct in thinking that this PR is undermined by us still using utils/color?

@mislav
Copy link
Contributor Author

mislav commented Sep 16, 2020

@vilmibm The gray fix also covers to the utils package πŸ‘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NO_COLOR variable ignored More nuanced color support

3 participants