hgcrpd
hgcrpd

Reputation: 1890

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.

Upvotes: 1

Views: 1167

Answers (2)

alpha_989
alpha_989

Reputation: 5350

You should use :!python % to run the file, after putting in a breakpoint or otherwise.

Then you would be able to kill the python processs with Cntrl+C

Upvotes: 0

ZyX
ZyX

Reputation: 53604

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.

Upvotes: 2

Related Questions