Blender hangs on exit with console window open? Has anyone run into an issue with Blender randomly freezing/hanging when you attempt to close while the console window is open? I can't say for sure that the console is the murder weapon, but after a lot of testing, it seems likely. I've tried disabling all non-official add-ons (including my own) with no change. I'm running into this on two Windows PCs with very different hardware.

Nothing prints out in the console when I press the Windows "x" button. It just instantly freezes and doesn't respond until I force it closed with task manager. It randomly hangs maybe once every 4-5 times I close it. Sometimes much more frequently.

I'm curious to know if this is happening to others, but mainly I'm looking for any type of solution. Maybe a way to force the console window closed before exit? I don't think it can be done with atexit, because it never seems to get executed in my add-on before Blender locks up. If nothing else, it may be possible to create a custom hotkey that closes the console window, then requests Blender to close?
Clicking in the console window and accidentally selecting some text will put the console window into 'selection' or 'mark' mode to mark the part you want to copy to the clipboard. This will cause any additional output to the console to ‘hang’ (it blocks any further output to the console so the visible text doesn't change while you're trying to mark your selection) which will block Blender when it tries to output additional text to the console such as just before it exits. Pressing Return or Esc while on the console window will accept or cancel selection mode, allowing Blender to continue outputting to the console so it can continue.

This is how the Windows console works (rather than being a Blender feature) and the only way of avoiding it is to be careful when switching to the console window and avoid selecting any text (or immediately cancel 'mark' mode by pressing Return or Esc).