Feature #3062
closedAdd --no-color support
Updated by Ohad Levy over 10 years ago
should this be the default? or can we detect the terminal and bg colors correctly?
Updated by Marek Hulán over 10 years ago
We can detect it using `tput colors` (even if it's not really OS agnostic).
But in general I'd say that installer in most cases will be used in color enabled terminals and displayed to people so color should be on by default. If we added users a way to disable them I thing that would be ok as well.
Updated by Dominic Cleal over 10 years ago
Often programs check for a tty to determine if it's interactive or non-interactive, so would provide a useful default.
Updated by Lukas Zapletal over 10 years ago
Again, if it is possible to get it into 1.3 I'd love to invest some time and cherry-pick that. I'd love to keep my beaker tests consistent for all foreman-installer based releases.
As Dominic said, the best way is the UNIX way. If the terminal is interactive, go for colors, otherwise go for non-colored mode. But please keep this option because I think beaker emulates terminal (while it is writing the output to log database).
Updated by Lukas Zapletal over 10 years ago
And I think it is okay to use /usr/bin/tput, if the binary is not there, just fallback to non-colored mode. We do not want to draw another dependency just to make a syscall. Please check katello-configure I think I have been already implementing some hack to rind out number of columns using tput with a fallback there:
https://github.com/Katello/katello-configure/blob/master/lib/util/functions.rb#L45
Updated by Marek Hulán over 10 years ago
- Status changed from New to Ready For Testing
- Assignee set to Marek Hulán
Updated by Marek Hulán over 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 36251275bf760eb39504ad14a6eb856ac9bdfd0c.