-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Git Bash replaces forward slashes with backslashes when running "node" #740
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
Comments
This is not Git's behavior, most likely, but Bash's, and it is inherited from the MSYS2 runtime that is used by Git's Bash to emulate POSIX functionality. The reason for this behavior is that Bash expects POSIX paths (forward slashes) and when calling non-MSYS2 programs, it expects them not to be able to handle them correctly, but instead to prefer Windows' native directory separators (backslashes). So it is very much by design what you are seeing. If you need to pass options containing forward slashes, there are several ways to do that:
|
No, MSYS2 doesn't have the behavior I described.
The behavior I described only happens in the specific case where the program being run is "node" and not in the generic case, so you're thinking of something else.
As you can see in the example I provided, Git Bash replaces slashes regardless of their position. |
This is probably caused by winpty: git-for-windows/build-extra@44ed99b |
@seishun are you absolutely certain? I ask because I'd like you to point me to code in
@Radrik5 good conjecture. If that is the problem, using |
https://github.com/rprichard/winpty/blob/a22f493982bb9847c48200912df7a66d23750a02/src/unix-adapter/main.cc#L152 would be my guess. |
But this only converts |
Well what do you know. Indeed, vanilla winpty doesn't replace slashes in the remaining arguments. But MSYS2 provides a patched version that does. I can see the intention behind it, but it's inconsistent with how MSYS2 itself handles path conversions when running non-MSYS2 programs. |
…updater (git-for-windows#740) As pointed out in microsoft#739, the VS registry settings are added only if the autoupdater feature is enabled. This was unintentional; Just like the corresponding part in the uninstaller, these two things should be apart. So let's decouple the VS registry settings from the autoupdater. Let's do that by ensuring that we put the function calls _outside_ of the autoupdater blocks. For good measure, we add checks to verify that both calls _were_ added, i.e. that the expected patterns were found. This fixes microsoft#739
or closed issue
matching what I'm seeing
Setup
output of
git version
as well.2.8.1, 64-bit
Windows 10, 64-bit
defaults?
Defaults
to the issue you're seeing?
No
Details
Git Bash
Minimal, Complete, and Verifiable example
this will help us understand the issue.
Compile the following C program, save it as
node.exe
, make a copy namednode2.exe
, make sure they're both in PATH.Then run the following:
Same output for all four commands, printing out the executable path and the argument as-is.
URL to that repository to help us with testing?
N/A
The text was updated successfully, but these errors were encountered: