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

Translate posix paths to windows paths for cygwin #778

Closed
account-login opened this issue Jun 20, 2021 · 6 comments
Closed

Translate posix paths to windows paths for cygwin #778

account-login opened this issue Jun 20, 2021 · 6 comments

Comments

@account-login
Copy link

Hello, as #619 points out, the experience of using fd on cygwin is not great.

I propose adding the --cygwin-path flag to fd. When enabled, paths in command line will be translated to windows paths using the cygpath command.
For example, fd --cygwin-path xxx /usr /cygdrive/z will be translated to something like fd xxx C:/cygwin/usr Z:/.
Here is a proof of concept implementation: account-login@8cf8ebf

Just FYI, I have also posted the same proposal to the ripgrep project: BurntSushi/ripgrep#1905

@sharkdp
Copy link
Owner

sharkdp commented Jun 28, 2021

I'm not sure I understand this completely. What would this path translation gain us? Is something not working without it? Or are you more concerned about the precise form of the output?

@sharkdp
Copy link
Owner

sharkdp commented Jun 28, 2021

Slightly related: #153 (comment)

@account-login
Copy link
Author

This issue is about the input paths in the command line, not the output.

@sharkdp
Copy link
Owner

sharkdp commented Jul 4, 2021

Okay, but could you please answer this question:

What would this path translation gain us? Is something not working without it?

@sharkdp
Copy link
Owner

sharkdp commented Aug 8, 2021

I'm closing this due to inactivity. Please feel free to comment in case it should be re-opened.

@sharkdp sharkdp closed this as completed Aug 8, 2021
@cebaa
Copy link

cebaa commented Aug 9, 2022

One answer to:

What would this path translation gain us? Is something not working without it?

is consistency when using -p. For example:

$ alias fd
alias fd='fd --path-separator /'
$ cd /tmp
$ mkdir test
$ cd test
$ touch hello
$ find /tmp/test
/tmp/test
/tmp/test/hello
$ cd /tmp
$ fd -p '.*/test/.*'
$ fd -p '.*\\test\\.*'
test/hello
$

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