-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
can't find wildcard file names on Cygwin #263
Comments
If I go to that folder, it opens the file: $ cd /cygdrive/c/prog/bin/
$ bat rncfix.pl
#!perl -wp0 |
Thank you for your feedback. This isn't about wildcards. The problem is that
because it is not a valid Windows path. ripgrep has a similar problem (see BurntSushi/ripgrep#269). I personally won't work on this (see my comment in #210), but if someone wants to tackle this, I'm happy to accept a PR if the solution doesn't add a lot of code (especially platform-dependent). As a workaround, I guess you can call |
@VladimirAlexiev I can't confirm this actually works on cygwin since I don't use it, but I wrote a quick bash function that should suffice as a workaround. Just add it to your bat() {
local index
local args=("$@")
for index in $(seq 0 ${#args[@]}) ; do
case "${args[index]}" in
-*) continue;;
*) [ -e "${args[index]}" ] && args[index]="$(cygpath --windows "${args[index]}")";;
esac
done
command bat "${args[@]}"
} |
@VladimirAlexiev Any update on this? |
If I try with Windows path syntax, I get this (in both CMD and bash): $ bat c:\prog\bin\*.pl
[bat error]: The filename, directory name, or volume label syntax is incorrect. (os error 123) If I try with your function, it finds the files. |
With @eth-p's workaround successfully tested, I will close this as I currently don't have the intention to add cygwin-specific code to @VladimirAlexiev Your wildcard issue is already tracked in #309 |
Windows 10, cygwin
$ bat /cygdrive/c/prog/bin/*.pl [bat error]: The system cannot find the path specified. (os error 3) [bat error]: The system cannot find the path specified. (os error 3) [bat error]: The system cannot find the path specified. (os error 3) [bat error]: The system cannot find the path specified. (os error 3) [bat error]: The system cannot find the path specified. (os error 3) [bat error]: The system cannot find the path specified. (os error 3) [bat error]: The system cannot find the path specified. (os error 3) [bat error]: The system cannot find the path specified. (os error 3) [bat error]: The system cannot find the path specified. (os error 3) [bat error]: The system cannot find the path specified. (os error 3) [bat error]: The system cannot find the path specified. (os error 3) [bat error]: The system cannot find the path specified. (os error 3)
There are that many files, so it gets the globbled listing but for some reason can't open the files.
Trying with one of them:
$ cat /cygdrive/c/prog/bin/rncfix.pl #!perl -wp0 ... $ bat /cygdrive/c/prog/bin/rncfix.pl [bat error]: The system cannot find the path specified. (os error 3)
The text was updated successfully, but these errors were encountered: