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

Windows colors #37

Merged
merged 2 commits into from
Feb 20, 2018
Merged

Windows colors #37

merged 2 commits into from
Feb 20, 2018

Conversation

stevepentland
Copy link
Contributor

This adds a new style value 'NoColor' that maintains most output styles, but removes coloring from output. On Windows, this is the default setting if Full would have been used.

This maintains most output styles, but removes coloring from output. On Windows,
this is the default setting if Full would have been used
@sharkdp
Copy link
Owner

sharkdp commented Feb 19, 2018

Thanks!

Do you think this should be the default on Windows? I doubt that developers on Windows use cmd.exe and hope they would rather use Powershell...(?)

@stevepentland
Copy link
Contributor Author

Well, the default shell on modern Windows 10 has become powershell at this point. I would lean towards stating this provides a consistent user experience between both Windows shells.

if options.output_style == OutputStyleOption::Basic {
// We default Windows to NoColor if full had been specified.
if cfg!(windows) && options.output_style == OutputStyleOption::Full {
options.output_style = OutputStyleOption::NoColor;
Copy link
Owner

Choose a reason for hiding this comment

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

If implemented in this way, there is no way to change to Full on Windows, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That’s correct, on Windows, full is essentially NoColor. I felt that it would just improve consistency across shells on the platform.

Copy link
Owner

Choose a reason for hiding this comment

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

For fd, we ended up using this helper function: https://github.com/sharkdp/fd/blob/7a3994decb8b38162ef9f89d19e227569a379e81/src/windows.rs#L17-L39

I think we should definitely allow for a true Full style on Windows. If someone uses cmd.exe, he can use --style basic or --style nocolor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, there’s nothing about the colours that don’t work on cmd or powershell, but they are just not properly visible on the default powershell background. I think we have two straightforward options: either we make full->full and auto->nocolor or change the current colour choices to properly be visible on the default powershell background. After thinking about this more the latter seems the most reasonable. My screenshot in the PR for enabling the progress bar shows the problem areas

Copy link
Owner

Choose a reason for hiding this comment

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

Okay, right. I'll merge this and if we want to enable color support on Windows, we should first update the colors.

@sharkdp sharkdp merged commit 4829dfb into sharkdp:master Feb 20, 2018
@stevepentland stevepentland deleted the windows-colors branch February 22, 2018 04:08
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