Skip to content

Conversation

jonathanslenders
Copy link
Member

No description provided.

@jonathanslenders jonathanslenders merged commit 0ccec5d into master Jan 27, 2022
@jonathanslenders jonathanslenders deleted the handle-sigint branch January 27, 2022 10:50
@asmeurer
Copy link
Contributor

asmeurer commented Feb 8, 2022

I've been using my own SIGINT handler, which is just a thin wrapper around some cleanups + raise KeyboardInterrupt. I tried replacing it with this and it doesn't work. Does this only trigger when the prompt is active?

@jonathanslenders
Copy link
Member Author

jonathanslenders commented Feb 9, 2022

This is indeed only active for the duration of the prompt. The request came from the Xonsh community. It appears that Readline listens for SIGINT too, and an external process can send a SIGINT to the process which behaves exactly like pressing control-c.

If you're setting up a custom SIGINT handler of your own, I wonder whether this change does not interfere with yours and overrides that signal handler.

@asmeurer
Copy link
Contributor

asmeurer commented Feb 9, 2022

I just realized my SIGINT handler is not necessary and I can handle KeyboardInterrupt directly. So this isn't really a problem for me like I thought it would be.

I'm actually having a hard time figuring out if my SIGINT handler ever actually worked at all. I can't get it to trigger, even in older versions of prompt-toolkit. I was pretty sure I had it working, so I'm not sure what is different now.

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.

2 participants