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

mise does not operate well under GitBash on Windows #4011

Open
jdx opened this issue Jan 8, 2025 Discussed in #3961 · 0 comments
Open

mise does not operate well under GitBash on Windows #4011

jdx opened this issue Jan 8, 2025 Discussed in #3961 · 0 comments

Comments

@jdx
Copy link
Owner

jdx commented Jan 8, 2025

Discussed in #3961

Originally posted by zartc January 6, 2025
As a user of GitBash (which comes with Git for Windows), I installed the 2025.1.0 Windows-x64 (ef6936a 2025-01-01).
The program works fine, but it produces paths that are incompatible with GitBash. Any command that updates the PATH variable (including eval $(mise activate bash)) corrupts the GitBash terminal session, rendering it unusable because GitBash cannot find any commands anymore due to the corrupted PATH variable.

The problem:

mise outputs paths in Windows format: C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin using the C: prefix, the \ directory separator, and the ; path separator. However, GitBash expects paths to be in Linux format: using /c/ prefix, / directory separator, and : path separator.

One element of solution:

When running under GitBash ($OSTYPE == "msys"), paths generated by mise should be in Linux format using the / and : separators. In addition, paths pointing to directories inside the GitBash installation directory should be without the C:\Program Files\Git prefix, so that they are seen as absolute paths inside the Linux VFS. For example, C:\Program Files\Git\mingw64\bin => /mingw64/bin, C:\Program Files\Git\usr\bin => /usr/bin.

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

No branches or pull requests

1 participant