Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Killing Python with a keybinding in VS code

I’m experimenting with some Python code that generates sound. I’m using VS code. I’ve set up a keyboard shortcut for the "Python: Run Python File" action, which starts the sound playing in a terminal window.

In order to stop the sound, I have to first click in the terminal panel and then I can do CMD-. (Mac equivalent of ctrl-C.) This takes a couple of seconds though, and if my code is unexpectedly producing a very loud sound I’d like to be able to stop it as quickly as possible.

So my question is, is there a way I can set up a keybinding to immediately stop the running Python process, without first needing to click in the terminal panel where it’s running?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

There are a number of actions that sounded like they should work, such as "Terminal: Kill the Active Terminal in Editor Area" (bound to CMD-w by default). However, this just seems to close the source file without affecting the terminal at all.

>Solution :

try this settings i guess third setting works for you 🙂

terminal kill

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading