Debugging with ESP32C6, can we have the serial monitor close automatically on ending debug?

Debugging with an ESP32C6-DevKitC-1 finally got it working. While testing my code I open the Serial Monitor to view output and that works fine too. BUT, if I stop debugging and make some code changes and then restart debugging or try uploading, I get an error that the COM port for upload is not available. It turns out the serial monitor on this kit uses the same com port for upload as well as serial output. If I close serial monitor first, then all is fine. Is there a simple way to have the serial monitor close down when the debugger is stopped, so that I don’t have to keep remembering to close it before the next debug or upload attempt?