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

StackOverflow https://stackoverflow.com/questions/17416320

  •  02-06-2022
  •  | 
  •  

Frage

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.

War es hilfreich?

Lösung

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.

Andere Tipps

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top