-
Notifications
You must be signed in to change notification settings - Fork 489
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
[BUG]: MSYS2: command line argument mangling - how to disable? #2316
Comments
The command you have shown is a DOS style. In nix world, forward slash is used for directories, not for command line option. So you have to use Command Prompt or Poweshell like shells for that. Or use |
Perhaps try prefixing your commands with |
https://www.msys2.org/wiki/Porting/#filesystem-namespaces
|
Another good trick, that works for many if not most Windows programs that take |
Thank You ! Yes, 'export MSYS2_ARG_CONV_EXCL=*' works to disable these conversions. |
It still does not work for the Visual Studio CL.EXE command: $ export 'MSYS2_ARG_CONV_EXCL=*' cl : Command line error D8004 : '/W' requires an argument $ cl '//?' hangs forever, have to press +'C' (^C)$ cl '-?' prints expected help documentationPlease, could you point out where in the MSYS2 source code this argument mangling is going on ? Then I can build a version that completely disables it, and post back here a patch. |
Try with |
I just replaced my Cygwin64 installation with MSYS2 (insufficient storage for both) -
looking forward to using full-featured Clang-11 & llvm-11 (unlike MS versions) - thanks! -
but now I find MSYS2 seems to be mangling command lines like :
$ REG QUERY HKCU\Environment /v Path
ERROR: Invalid syntax.
Type "REG QUERY /?" for usage.
$ REG QUERY /?
ERROR: Invalid syntax.
Type "REG QUERY /?" for usage.
Something seems to be translating '/v' and '/?' in the above examples into '/c/v' and '/c/?' :
I really think it is a very bad idea to modify the command line arguments that the user enters like this -
let users be responsible for entering correct command line arguments, don't try to second guess what they
intended - this only leads to chaos / disaster.
Effectively, MSYS2 is unilaterally refusing to allow users to enter any command line argument that begins with '/' -
it will mangle all such arguments into /c/ . What if I need to work with strings that begin with '/' which are not
file names ? You have made this impossible to do with MSYS2 .
Please, could you let me know if there is a way of disabling this command line mangling ?
And which component is actually doing the mangling ? It must be something in bash, since a bash shell script
does not get its '/' prefixed arguments mangled, only windows programs do.
If this cannot be disabled and you won't fix it, please point out where in the MSYS2 code this mangling is going on so I can build an MSYS2 version that does not do this, for my own use. Otherwise, I'm going to have to go back to Cygwin.
Thanks & Best Regards,
Jason
The text was updated successfully, but these errors were encountered: