Close serial terminal when uploading in VS Code


#1

It would be awesome if the serial terminal were automatically closed when uploading a build. Currently my process looks something like:

  • watch some output on the serial monitor
  • make code changes
  • build
  • upload
  • upload fails, so I remember I left the serial monitor open
  • hunt for the serial monitor window to close it
  • re-upload

:slight_smile: It would be awesome if the middle steps could be skipped.


#2

If you open serial monitor via Serial Monitor button on the bottom toolbar, PIO IDE should close it automatically.
Nevertheless, we depend on VSCode API from Microsoft


#3

This doesn’t seem to work for me – I still have to manually close the serial monitor in VS Code when I upload new code.


#4

If you use buttons on PIO Toolbar, all should work. I’ve just pressed “monitor” button, then “upload” and VSCode asked me to terminate existing task. This is a temporary workaround while VSCode does not have proper API to terminate particular task.