2

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?

Llaves
  • 261
  • 3
  • 10
  • 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. – Dave Newton Jun 14 '21 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 '21 at 13:31
  • See https://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. – Dave Newton Jun 15 '21 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 '21 at 15:05
  • 1
    @DaveNewton - see my issue at [the github repot](https://github.com/microsoft/vscode-arduino/issues/1289) – Llaves Jun 15 '21 at 15:41

0 Answers0