-
Notifications
You must be signed in to change notification settings - Fork 178
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
Git bash on windows no longer supports pixi shell
#417
Comments
Hey, sorry for the late reaction. I've been debugging this and it is not as easy as thought on first glance. The issue is that our current implementation for bash is depending on some unix specific dependencies. ( I'll look at it some more very soon, but if you have any ideas let me know! |
I wonder if one workaround can be to use
That should start a bash shell inside an activated environment. Would love to hear if that works - we could add it to our docs, or make that the default behavior on Windows (if it works well enough). |
sorry for slow reply (have been on leave). Just got around to testing and seems to work as desired for the a few test commands I threw at it. Thanks! |
I went through the steps in the Basic usage page in both Ubuntu 22.04 (via WSL) and Git Bash. My observations:
|
@jdblischak thanks! About your last point - I think that might be related to the Windows file system just being slower? Although I am not sure how that maps to WSL. |
That is also my guess. My experience is that any code that touches the file system is noticeably slower on Windows. Just wanted to report to note that Windows users can't expect the same amazing speeds from
That's the beauty of WSL. For the most part it behaves like you are running your code directly on Ubuntu, so |
I believe windows defender might play a role in the speed as well as it wants to scan everything that is downloaded. Could be that WSL is able to sidestep Windows defender. |
When I run ❯ pixi shell-hook --shell bash
export PATH="/c/Users/user2/myproj/.pixi/envs/default;/c/Users/user2/myproj/.pixi/envs/default/Library/mingw-w64/bin;/c/Users/user2/myproj/.pixi/envs/default/Library/usr/bin" The PATH is exported incorrectly and needs to look like this for it to work in Git Bash: export PATH="/c/Users/user2/myproj/.pixi/envs/default:/c/Users/user2/myproj/.pixi/envs/default/Library/mingw-w64/bin:/c/Users/user2/myproj/.pixi/envs/default/Library/usr/bin" In short, the PATH separator must be corrected from Git Bash comes with a utility called ❯ cygpath -u -p "C:\Users\user2\myproj\.pixi\envs\default;C:\Users\user2\myproj\.pixi\envs\blabla"
/c/Users/user2/myproj/.pixi/envs/default:/c/Users/user2/myproj/.pixi/envs/blabla The ❯ cygpath -w -p "/c/Users/user2/myproj/.pixi/envs/default:/c/Users/user2/myproj/.pixi/envs/blabla"
C:\Users\user2\myproj\.pixi\envs\default;C:\Users\user2\myproj\.pixi\envs\blabla Perhaps Here is one method that implements this suggestion. I also found the following related content:
That A good enough solution might not even need to call into cygpath: just replace all A workaround is as follows: ❯ eval "$(pixi shell-hook --shell bash | sed 's/^export [Pp][Aa][Tt][Hh]=/export PATH=/I; s/;/:/g')"
❯ echo $PATH
/c/Users/user2/myproj/.pixi/envs/default:/c/Users/user2/myproj/.pixi/envs/default/Library/mingw-w64/bin:/c/Users/user2/myproj/.pixi/envs/default/Library/usr/bin |
If you need to use |
Follow up from #514 (comment) . If I run pixi shell-hook --shell path, the PATH is not correctly set for the reason specified by @W1M0R in #417 (comment) . fyi @ruben-arts |
Perhaps try exclude the pixi folders. Powershell as admin: #show existing exclusions
Get-MpPreference | Select-Object -ExpandProperty ExclusionPath
# add new ones
Add-MpPreference -ExclusionPath "D:\apps\pixi\bin"
# remove
Remove-MpPreference -ExclusionPath "C:\path\to\directory" This can be overriden by group policy from the domain admin. There's no error when adding/removing in this case, so always finish with 'show existing' to see what took hold. If you're on Win 11 try setting up a Dev Drive. I've done this at home and it improves things that use thousands of files (which is most any cross-platform project that includes linux). |
Checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pixi, using
pixi --version
.Reproducible example
on windows in git bash
Issue description
On windows in a git bash terminal,
pixi shell
fails with errorExpected behavior
pixi shell
should work as expectedThe text was updated successfully, but these errors were encountered: