First time here? Check out the FAQ!
1

Trapping sigint to ask for a key press

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)?

Dan Mahoney's avatar
11
Dan Mahoney
asked 2018-07-12 13:59:00 -0500
Wingware Support's avatar
4k
Wingware Support
updated 2019-03-13 09:46:48 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

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.

Wingware Support's avatar
4k
Wingware Support
answered 2018-07-12 14:28:00 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer