-
Notifications
You must be signed in to change notification settings - Fork 180
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
Powershell fails every prompt in pixi shell after cancelling (ctrl+c) #514
Comments
I can recreate it! Will take a look at this later. |
Added the help wanted label as we don't know where this is coming from. |
I am experiencing this also on Command Prompt. Interestingly, it seems that the pixi environment is actually active when the prompt does not have the
In this case, |
This is particularly annoying as it appears to happen when you use Ctrl+C to close a running program, like: pixi shell
runsomeprogram :: You press Ctrl+C to exit
:: now the shell is corrupted I guess most users on Windows are probably using |
He @traversaro, please enlighten us! The initialization of the powershell can be found here: Lines 37 to 70 in 58ab590
This is the prompt: Lines 37 to 43 in 58ab590
This is all the code around activation: https://github.com/prefix-dev/pixi/blob/main/src/activation.rs Would be happy to help if you feel like you found the culprit! |
I have the same issue. Steps:
Are there any Ctrl + C hooks that could cause this behavior in the |
great sleuthing @Petzep, thanks! It's great to have a comprehenisble explanation, hopefully that reveals a path to a fix. Only new bit I can add to the conversation is that this is not console software dependent. It happens for me in CMD and Powershell, and doesn't matter if run within default Windows, Windows Terminal or ConEmu. |
At least on my environments, the activation of pixi on windows take ~1/2 seconds, that makes it complicated to use
That is far from perfect (you are basically ignoring the Another alternative is to use https://github.com/synapticarbors/pixi2ces to create a conda lock file and create a different conda environment, but to be honest I do not love it as it as the same downside of the previous method, with the additional overhead of having a different conda environment, that can quickly diverse from the pixi one unless you pay attention. |
Does `eval "$(pixi shell-hook -s bash)" work? |
Probably this is more related to #417 ? Anyhow, I just tried and it hangs for ~1/2 seconds, and then it exists but it does not seem to me that the environemnt is actually activated. |
Actually the environment is activated, but the |
Ah because of that, issue in #417 with the path... |
Running into this as well, both in the command prompt and in PowerShell. The simplest repo is like this:
CMD will show an incorrectly exited Python interpreter, whereas PowerShell will just lock up after a few Enter presses (on a beefy machine). |
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
(see description)
Issue description
pixi shell
sleep(1000)
(or any other long running command-1073741510
. In my case the oh-my-posh shell plugin also gets.. issues:Expected behavior
continue operating as normal
The text was updated successfully, but these errors were encountered: