You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Git bash on windows no longer supports pixi shell #417
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
pixi shell
Issue description
On windows in a git bash terminal, pixi shell fails with error
$ pixi shell
x Unsupported shell: Bash(Bash)
Expected behavior
pixi shell should work as expected
Reacted by John Blischak, jslorrma, Willie Möller, Pavel Zwerschke, Jakob Everding, Dheepak Krishnamurthy, escalonn, Abdullah Saydemir, Nick Ulle, Dr. Dominik Jain and 1 more
Reacted by yonil7, Mikkel Roald-Arbøl, Abdullah Saydemir and Marcelo Trevisani
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. (PtySession) Which isn't available, so we have to write this interaction ourself. Which is easy for PowerShell and nushell because the except a source file on start. But for bash you have to send a command to the running instance.
I'll look at it some more very soon, but if you have any ideas let me know!
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).
@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.
I think that might be related to the Windows file system just being slower?
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 pixi as those on a Unix file system (though of course pixi is still much faster than alternatives like conda on Windows, so they should still switch 🙂)
Although I am not sure how that maps to WSL.
That's the beauty of WSL. For the most part it behaves like you are running your code directly on Ubuntu, so pixi is super fast
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.
Perhaps pixi shell-hook --shell bash should detect if the cygpath.exe executable is in the path, and if so, then use it to normalize the PATH variable first.
Here is one method that implements this suggestion.
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.
Perhaps try exclude the pixi folders. Powershell as admin:
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).
Activity
ruben-arts commentedon Nov 14, 2023
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. (
PtySession) Which isn't available, so we have to write this interaction ourself. Which is easy forPowerShellandnushellbecause the except a source file on start. But for bash you have to send a command to the running instance.I'll look at it some more very soon, but if you have any ideas let me know!
wolfv commentedon Mar 12, 2024
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).
tony-p commentedon Mar 20, 2024
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!
jdblischak commentedon Mar 21, 2024
I went through the steps in the Basic usage page in both Ubuntu 22.04 (via WSL) and Git Bash. My observations:
pixi shellpixi run bash.exeis a good substitutepixi add pythonwas noticeably slower in Git Bash compared to Ubuntu (despite running on the same hardware)wolfv commentedon Mar 21, 2024
@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.
jdblischak commentedon Mar 21, 2024
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
pixias those on a Unix file system (though of coursepixiis still much faster than alternatives likecondaon Windows, so they should still switch 🙂)That's the beauty of WSL. For the most part it behaves like you are running your code directly on Ubuntu, so
pixiis super fasttony-p commentedon Mar 22, 2024
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.
W1M0R commentedon May 30, 2024
When I run
pixi shell-hook --shell bashin a Git bash terminal on Windows, I get the following output (redacted for simplicity):The PATH is exported incorrectly and needs to look like this for it to work in Git Bash:
In short, the PATH separator must be corrected from
;to:.Git Bash comes with a utility called
cygpath, that can translate Windows path lists to the correct format:❯ 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/blablaThe
cygpathutility can also translate the other way around:Perhaps
pixi shell-hook --shell bashshould detect if thecygpath.exeexecutable is in the path, and if so, then use it to normalize the PATH variable first.Here is one method that implements this suggestion.
I also found the following related content:
pixi/src/cli/shell_hook.rs
Lines 73 to 79 in b7d3816
That
path_modification_behaviorargument sounds promising.A good enough solution might not even need to call into cygpath: just replace all
;with:in the PATH environment variable.A workaround is as follows:
traversaro commentedon Aug 22, 2024
If you need to use
Git Bashwith pixi shell, a (definitely non perfect) workaround is the one that I explain in #514 (comment) .traversaro commentedon Aug 22, 2024
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
maphew commentedon Aug 22, 2024
Perhaps try exclude the pixi folders. Powershell as admin:
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).
traversaro commentedon Aug 18, 2025
Thanks a lot @mwiebe @ruben-arts !