Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

--nocolor implies --noheaders #67

Closed
Rogier-5 opened this Issue Jan 18, 2014 · 3 comments

Comments

Projects
None yet
2 participants

Hi,

I just learnt about and installed dstat, and it promises to be a permanent addition to my toolset. Thanks.

While experimenting, I noticed that the option --nocolor also enables --noheaders. However, while I prefer not having any colors, I still want to run it in a terminal, and so, not having a line of headers on the screen after dstat has been running for some time is quite inconvenient.

Could you consider separating these two, so that a colorless display with headers is still possible ?

@dagwieers dagwieers added the feature label Feb 5, 2014

Owner

dagwieers commented Feb 5, 2014

Agreed. The rationale was that either you had a terminal that was capable of colors, escape controls (updates) and rows/columns (headers) information, or you didn't. And the --nocolor option is assuming that if you haven't got colors, you wouldn't have all the other functionality :-)

But I was completely ignoring that maybe someone would simply hate to have colors. And now that I think of it, I have not thought about color-blindness either...

If I would implement it, you would also be getting intermediate updates. Is that correct ?

Rogier-5 commented Feb 5, 2014

Agreed. The rationale was that either you had a terminal that was capable of colors, escape controls (updates) and rows/columns (headers) information, or you didn't. And the --nocolor option is assuming that if you haven't got colors, you wouldn't have all the other functionality :-)

So in fact, the --nocolor option disables interactive display mode instead of just disabling colors ?

If I would implement it, you would also be getting intermediate updates. Is that correct ?

I would expect --nocolor to eliminate the colors, but not change the output in any other way. So, it would leave intermediate updates enabled. Is that what you mean ?

BTW, an alternative would be to add a '--headers' option to re-enable repetitive headers. The added benefit, is the the output of dstat can then be piped through a postprocessing stage, and modified (e.g. by computing a derived statistic) before it is printed on-screen.

Owner

dagwieers commented Feb 5, 2014

What you expect makes total sense in hindsight, so I need to fix it. So rather than a feature, this is a bug. Let's retag :-)

If you pipe output from dstat, we don't have a terminal and so colors, intermediate updates and headers are disabled by default in this case. The problem is that --nocolor implies the same, which is incorrect.

@dagwieers dagwieers added bug and removed feature labels Feb 5, 2014

@dagwieers dagwieers closed this in 37beb85 Feb 5, 2014

@dagwieers dagwieers added this to the 0.7.3 milestone May 16, 2016

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