Issue #1 resolved

cli.exe quits on ctrl-c, but python doesn't

Guy Rozendorn
repo owner created an issue

the cli should use SetConsoleCtrlHandler to ignore CTRL-C and pass it to its child process

The idea is to set an internal control event handler, rather than using the default one (that kills the cli). the new handler should pass the ctrl-c event to the python child pid, by using GenerateConsoleCtrlEvent. the new handler is set by using SetConsoleCtrlHandler.

so you need a control handler function, and to set it up. you also need the child pid (to send the ctrl-c to), but spawnv doesn't return it. so you also need to move to CreateProcessA and WaitForSingleObject. in order to use CreateProcess, you need to convert ptr and newchars into one big char*.

Comments (1)

  1. Log in to comment