processing-vscode icon indicating copy to clipboard operation
processing-vscode copied to clipboard

[Question] Is it possible to automatically terminate a processing Sketch by building a new one?

Open codevogel opened this issue 6 years ago • 4 comments

If I press CTRL+SHIFT+B to build a new version of my Sketch and run it, and then edit a few variables, and press CTRL+SHIFT+B again, I'll get VSCode telling me the following:

image

Firstly, there is no keyboard shortcut for selecting either 'Terminate Task' or 'Restart Task', so you'd still have to use the mouse to choose either option.

Even if you restart/terminate the task, it will terminate the previous task, and potentially restart it again. This builds a new version of the sketch and runs it.

However, the previous Processing sketch will still be open. So you'll now be looking at two sketches, one old, one new.

Currently I have to close the processing sketch by first switching from vscode to the window, and then closing it, then switch back to vscode and CTRL+SHIFT+B again.

Is it possible to set it up in such a way that you could just press CTRL+SHIFT+B again and have it close your previous sketch and build and launch a new one?

I could set up something like a globally active AHK script that terminates the process with my sketches name whenever I press CTRL+SHIFT+B, but I can see that causing some potential issues as well.

Your help is much appreciated!

PS: I don't seem to be able to label this issue as a Question?

codevogel avatar Oct 02 '19 13:10 codevogel

I'm not sure if this is possible given what I have access to in VSCode.

This may actually be fixed (or easier to fix) when I address #67 and have a custom terminal I can terminate when the extension is triggered?

AvinZarlez avatar Oct 07 '19 16:10 AvinZarlez

Thanks for the reply.

If anyone knows of a work around (if there's some other way to terminate the task when you shut down the application), then please let me know.

codevogel avatar Oct 20 '19 12:10 codevogel

Just adding a reply to see if there is a workaround for this in 2022. Would love to be able to disable that dialog box! Thanks ;)

disuye avatar Apr 27 '22 11:04 disuye

I found this workaround but cannot make it work for me - probably due to my inexpereince of this depth programming. Maybe someone else can figure it out.

https://stackoverflow.com/questions/76125453/in-vs-code-when-kicking-off-a-task-which-is-already-running-how-can-the-task-b

potential-difference avatar Aug 26 '23 11:08 potential-difference