Well a few ESP32 boards have a mechanism that connects RTS/DTR to the EN/GPIO0 lines – if these are driven the wrong way when the serial monitor opens, it might shut down the ESP32.
Can you try adding each of those blocks to the platformio.ini
and retry opening the serial monitor (just “Monitor” task)? If one doesn’t make a difference, delete it again and try the next one.
1.)
monitor_rts = 0
monitor_dtr = 0
2.)
monitor_rts = 0
monitor_dtr = 1
3.)
monitor_rts = 1
monitor_dtr = 0
4.)
monitor_rts = 1
monitor_dtr = 1
(docs for that command)