For a lack of a better description, look at this screenshot:
Sometimes, after an out of memory semi-crash, cmd windows remain in this state. If I click on them, nothing happens. (some of them work and open, but others stay in this state) The program run from these windows are still running. It's like the "host" of the window crashed. Obviously if I close them, they close and kill their spawned programs. I wish there was a way to resume them.
Addendum: This happebned to me already a few times in the past. It's like some reference or "father" process is dead and the windows associated with it are unresponsive (as windows, but the processes running inside them are still alive) Also some wsl "bash" windows are affected but no other windows are affected.. so I think it must be some "shell host" or similar process associated with those windows. But I don't know more than that. From past experience I know that if I kill them one by one, every new window (command prompt or bash) work without problems.
I am curious if there is any way to regain control of those windows.
The two windows on the left are responsive, but the 3 on the right are not. They don't pop up when clicking on them or using alt+tab or task manager.
I am 99% positive that the problem relies in CONHOST.
start "" program.exe
you can effectively start the program, then immediately return focus back to the cmd window, and if this is done in a batch script, the cmd window just closes.