This is more of an annoyance, but if I edit a program with the serial monitor open, click "upload", and the compile fails, the IDE switches to the serial monitor pane, opens the serial port which triggers a reset, and the last successfully uploaded version begins execution. This can be really annoying if you don't notice there were errors in the compile because VSCode automatically switches to the monitor pane and you waste time wondering why your code changes had no effect.

Is there any way to tell VSCode/Arduino add-in not to switch to the monitor pane in the event of a failed compile?

  • This doesn't happen for me; it compiles and ends with [Error] Uploading sketch 'blink.ino': Exit with code=1. You may need to provide more details. Jun 14, 2021 at 12:56
  • 1
    @DaveNewton - you're right, of course. I looked more closely at what's going on and revised the question to reflect what I think it happening.
    – Llaves
    Jun 15, 2021 at 13:31
  • See github.com/microsoft/vscode-arduino/issues/1061; switching to the CLI tools might resolve this, but a (very) cursory inspection of the plugin was unenlightening at best. I'll look in to this because the Arduino output/console output thing has been a pain point for me as well sometimes. Jun 15, 2021 at 13:41
  • @DaveNewton - look at Arduino.ts line 701. It appears that the CLI will behave the same way, as it also records if the Serial Monitor was open. The monitor is restored after compile at line 723 without checking if the compile was a success.
    – Llaves
    Jun 15, 2021 at 15:05
  • 1
    @DaveNewton - see my issue at the github repot
    – Llaves
    Jun 15, 2021 at 15:41


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.