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

pixi run + Ctrl C has weird behavior #168

Closed
pavelzw opened this issue Jul 2, 2023 · 1 comment · Fixed by #190
Closed

pixi run + Ctrl C has weird behavior #168

pavelzw opened this issue Jul 2, 2023 · 1 comment · Fixed by #190

Comments

@pavelzw
Copy link
Contributor

pavelzw commented Jul 2, 2023

❯ pixi run python
Python 3.11.4 | packaged by conda-forge | (main, Jun 10 2023, 18:08:41) [Clang 15.0.7 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> <Ctrl + C>
KeyboardInterrupt
>>> 
<closes python directly after Ctrl + C>
❯ python3
Python 3.11.4 (main, Jun  7 2023, 00:34:59) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> <Ctrl + C>
KeyboardInterrupt
>>> <python doesn't close, only closes on Ctrl + D>
@ruben-arts
Copy link
Contributor

This is a hard problem to solve. We start a process which we wait for. By default this seems to also catch the signals as well as the python executable itself.
This is the line that runs the process: https://github.com/prefix-dev/pixi/blob/main/src/cli/run.rs#L160

We found some solutions to the signal processing but that would make it much more complicated and it would not be cross platform:
https://users.rust-lang.org/t/prevent-program-from-exiting-on-child-sigint/7685/12

Any input much appreciated!

@tdejager tdejager mentioned this issue Jul 10, 2023
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

Successfully merging a pull request may close this issue.

2 participants