cli.exe quits on ctrl-c, but python doesn't
(originally sumbitted to setuptools: http://bugs.python.org/setuptools/issue120)
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*.