Search code examples
vimpython-mode

vim - python-mode - is there a way to send a Ctrl+C to a running script in pymode?


Is there a way to kill a python script that is being run by Python-mode? If the script were being run from the shell, you could press Ctrl+C to cause a KeyboardInterrupt, but this does not seem to work. The only way that I have been able to kill it is to kill the vim process entirely.


Solution

  • This is one of the problems recently discussed in vim-dev and in some other topics. This behavior requires patching vim source to have eventloop in a separate thread, but there is no patch for this yet.

    Currently there is no way to do this. Some running python scripts may be interrupted by sending a SIGINT, but not all.