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

Add windows compatibility #29

Closed
sebasv opened this issue Jun 7, 2017 · 13 comments
Closed

Add windows compatibility #29

sebasv opened this issue Jun 7, 2017 · 13 comments

Comments

@sebasv
Copy link
Contributor

sebasv commented Jun 7, 2017

This code is cross-platform save for the "executable file" check, which is only relevant on unix systems, and is done for the sole purpose of color-coding output lines.

I managed to make your code run on windows by adding conditional compilation operators to
use std::os::unix::fs::PermissionsExt; and to redefine the is_executable function on non-Linux systems.

@sharkdp
Copy link
Owner

sharkdp commented Jun 7, 2017

Thank you for trying this. I'll try to implement this as soon as I get access to a Windows system.

@sebasv
Copy link
Contributor Author

sebasv commented Jun 7, 2017

I'd be happy to create a pull request!

@sharkdp
Copy link
Owner

sharkdp commented Jun 7, 2017

That would be great, thank you.

@sharkdp
Copy link
Owner

sharkdp commented Jun 7, 2017

Apart from the current compilation problems, colored output does not work on Windows (no support for ANSI sequences). We could consider using termcolor.

@sebasv
Copy link
Contributor Author

sebasv commented Jun 7, 2017

PR #35 concerns windows compatibility.
Powershell does work with colored output. To be honest I haven't touched cmd since the inception of Powershell, but the termcolor crate looks like a nice feature for the hardcore cmd users!

@sharkdp
Copy link
Owner

sharkdp commented Jun 7, 2017

Oh, I didn't know that, that's cool! I just quickly tried cmd today.. thanks!

@sharkdp
Copy link
Owner

sharkdp commented Jun 9, 2017

Closed via #35

@sharkdp sharkdp closed this as completed Jun 9, 2017
@jmcomets
Copy link

I'm surprised this was closed considering colored output does not work in cmd.exe, I'm getting ansi escapes printed to the console every time I fire up fd and have to add the --no-color option each time. Maybe we should re-open this/add an issue on Windows coloring? termcolor crate sounded like a great option.

@sebasv
Copy link
Contributor Author

sebasv commented Jul 20, 2017

This issue was regarding compatibility; The code simply didn't compile on windows. Having to flag no-color should be the default behavior imho since this is a shortcoming of cmd, not Windows. If you want colored output, try Powershell. It's like bash and Python had a baby in Microsoft country. (And it's developed by MSFT)

@jmcomets
Copy link

jmcomets commented Jul 20, 2017 via email

@sebasv
Copy link
Contributor Author

sebasv commented Jul 21, 2017

Then by all means, start a pull request to add cmd support. I'm just saying that cmd support is not the same as windows compatibility, and should be opened as another issue.

@jmcomets
Copy link

jmcomets commented Jul 22, 2017

I looked into it a bit today, there's a few issues in order to implement it:

  • cmd has no support for "italic" or "underlined" text, in which case these options should be ignored
  • after checking out termcolor, I see no support for fixed colors. There seems to be work in progress here

@sharkdp
Copy link
Owner

sharkdp commented Jul 29, 2017

@jmcomets Cool, thanks for looking into this! I also think we should open a new issue for this.

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

No branches or pull requests

3 participants