Ask Your Question

Trapping sigint to ask for a key press

asked 2018-07-12 13:59:00 -0500

Dan Mahoney's avatar

updated 2019-03-13 09:46:48 -0500

The script that I'm working on is going to run for a long time. It's purpose is to identify and delete certain messages from a mailbox, then call imapclient.expunge() when complete. I have written a signal handler to trap SIGINT and ask the user what he wants to do next.

When I run the script in Wing IDE (6.0.12-1) the interrupt handler never gets called. I assume that Wing is hooking the SIGINT signal itself. Suggestions on how I can work around this (other than trapping some other signal)?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2018-07-12 14:28:00 -0500

If you are pressing Ctrl-C in Wing that ends up not sending SIGINT but may copy or something else depending on keyboard personality.  If you want to do this in Wing you probably need to configure the debugger to use an external console, which is done from the Debug I/O tool's Options menu.  Then pressing Ctrl-C in the separate console window should work.  Please let me know if that doesn't help.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-07-12 13:59:00 -0500

Seen: 1,931 times

Last updated: Mar 07 '19