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

fix: always show cursor after control+c #2635

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

ruben-arts
Copy link
Contributor

fixes #1548 #2625

The issue is related to and fixed with help of console-rs/dialoguer#77

@baszalmstra
Copy link
Contributor

I remember we explicitly removed ctrl+c handler at some point. @tdejager do you remember why?

@wolfv
Copy link
Member

wolfv commented Dec 3, 2024

We explicitly removed the CTRL+C handler in the pixi shell and the trampoline binaries because we want the underlying processes to handle CTRL+C. I am assuming that still works?

@wolfv
Copy link
Member

wolfv commented Dec 3, 2024

Also you can use ctrl_c from tokio so we don't need additional deps, check exec.rs.

src/cli/run.rs Outdated
@@ -326,6 +326,14 @@ fn disambiguate_task_interactive<'p>(
..ColorfulTheme::default()
};

// Ignore CTRL+C in the dialoguer prompt so that it shows the cursor again.
ctrlc::set_handler(move || {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still in favor of using tokio if we can make it work :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it back

@ruben-arts
Copy link
Contributor Author

I notice one weird thing with this change. It seems to work like I would expect when killing things run after this command. But canceling an install acts differently from cancelling a normal install:
image

This is repeatable for some reason, @wolfv or @baszalmstra would you know why that could happen? e.g. did I just introduce a terrible bug that my testing isn't verifying?

@wolfv
Copy link
Member

wolfv commented Dec 19, 2024

This is what the docs say. I wonder if we're in this situation - and need to come up with our own way of killing the remaining threads.

Screenshot 2024-12-19 at 17 06 07

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 this pull request may close these issues.

Cursor disapear after ctrl+c in a pixi menu
3 participants