How to make PlatformIO not restart the device when opening a COM port

How to make PlatformIO not restart the device when opening a COM port.

There is a big problem. I describe the situation:
The device is connected via a USB gateway to both the power supply and the computer. The computer is turned off.

The device works for several days and suddenly, by the system LED, I see that the device has fallen off WiFi and cannot reconnect back.

I turn on the computer - the device shows an error. Fine.

Launch VSCode + PIO - the device shows an error. Fine.

I open the terminal - the device reboots, the error is cleared. I can not see anything. An untranslatable set of curses addressed to developers

How to remove this bullshit ??? I did not find anything similar in the settings.
By the way, I’ve been trying to catch this error for many months now.