When using PlatformIO for an Arduino project I can click the Serial Monitor button and view serial output in the loop() function. However, I am having trouble viewing serial output in the setup() function because the Serial Monitor needs to re-opened after each recompilation / upload, at which time the setup() has already completed. An obvious workaround to the problem is to add a delay–and this works–but this undesirable.
Is there a more practical solution to this issue? Perhaps a way to keep the Serial Monitor open and connected between compilation / uploads? Or even dump the serial output to the Terminal output?