Platformio - restarting scetch after opening Serialmonitor

Hello my friends

I am using an ESP32. My IDE for that its VSCode with platformio.

What i noticed is, that when i open my Serial moitor, my scetch (and so my setup-part) is restarting.

Is there a way to deactivate that?

Thank you very much

This is the autoreset when a serial port is opened - serial monitor causes the DTR pin to be asserted when serial port is open (I think this is the default behavior?)
IIRC, on most ESP devboards, asserting DTR resets it like a normal arduino. Uploading uses that in combination with controlling the strapping pin via RTS to reset the board into serial upload mode. I'm not sure if there's a readily reversible way to change this behavior in hardware.

If you use a third party terminal application that lets you manually control those pins - hTerm is what I use - you can open the port without toggling DTR or RTS.

hTerm is a wonderful terminal for embedded developers - beyond that it lets you view and send data expressed as ascii or the value of the byte expressed in hex, decimal, or binary. On receiving you can choose to see data in one or more of those forms, and on sending, you can mix and match them (eg, send some letters, then a control code as hex, or something) and do all sorts of other cool things.