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

feat(config): default no_colors to false #344

Merged
merged 1 commit into from
May 5, 2022
Merged

Conversation

gelfand
Copy link
Contributor

@gelfand gelfand commented May 1, 2022

Default no_colors setting to false.

Why?

Before

Input below would produce no colors in tokio console, tho palette flag is explicitly passed, and no_colors is not explicitly set to true.

tokio-console --palette 256 http://127.0.0.1:6669

Input below also would produce no colors in tokio-console, tho COLORTERM is set to truecolor, and no_colors is not explicitly set to true.

COLORTERM=truecolor tokio-console http://127.0.0.1:6669 

Also would produce no colors in tokio-console, tho truecolor is explicitly passed.

tokio-console --truecolor http://127.0.0.1:6669

So to enable colors you must explicitly set no_colors to false, like so:

tokio-console --truecolor --no-colors false http://127.0.0.1:6669

After PR

Colors are enabled.

COLORTERM=truecolor tokio-console http://127.0.0.1:6669

Colors are enabled too.

tokio-console --palette 256 http://127.0.0.1:6669

Colors are disabled, because no_colors is explicitly passed, tho COLORTERM is set to truecolor.

COLORTERM=truecolor tokio-console --no-colors http://127.0.0.1:6669

Explanation

I think it's just not really obvious that you need to explicitly pass --no-colors false to enable colors, so it should default to false.

@gelfand gelfand requested a review from a team as a code owner May 1, 2022 08:55
Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, this looks good to me!

tokio-console/src/config.rs Show resolved Hide resolved
@hawkw hawkw merged commit e58352f into tokio-rs:main May 5, 2022
hawkw added a commit that referenced this pull request May 24, 2022
<a name="0.1.6"></a>
## 0.1.6 (2022-05-24)

#### Bug Fixes

*  default `--no_colors` to `false` (#344) ([e58352f](e58352f))

#### Features

*  add subcommand to gen shell completions (#336) ([df4d468](df4d468))
*  display outliers in histogram view (#351) ([dec891f](dec891f))
hawkw added a commit that referenced this pull request May 24, 2022
<a name="0.1.6"></a>
## 0.1.6 (2022-05-24)

#### Bug Fixes

*  default `--no_colors` to `false` (#344) ([e58352f](e58352f))

#### Features

*  add subcommand to gen shell completions (#336) ([df4d468](df4d468))
*  display outliers in histogram view (#351) ([dec891f](dec891f))
hawkw added a commit that referenced this pull request May 24, 2022
<a name="0.1.6"></a>
## 0.1.6 (2022-05-24)

#### Bug Fixes

*  default `--no_colors` to `false` (#344) ([e58352f](e58352f))

#### Features

*  add subcommand to gen shell completions (#336) ([df4d468](df4d468))
*  display outliers in histogram view (#351) ([dec891f](dec891f))
hawkw added a commit that referenced this pull request May 24, 2022
<a name="0.1.6"></a>
## 0.1.6 (2022-05-24)

#### Bug Fixes

*  default `--no_colors` to `false` (#344) ([e58352f](e58352f))

#### Features

*  add subcommand to gen shell completions (#336) ([df4d468](df4d468))
*  display outliers in histogram view (#351) ([dec891f](dec891f))
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.

2 participants