Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my command prompt freezing on Windows 10?

I'm adding this question after spending an entire day wrestling with this incredibly frustrating feature of the Windows 10 command prompt which made me think there was something wrong with my console application code. I hope it will help someone.

Issue: My console application seems to randomly stop running. What is going on?

like image 471
Shaun Rowan Avatar asked Nov 24 '15 00:11

Shaun Rowan


People also ask

Why is my Command Prompt not responding?

If Command Prompt is not opening on your Windows PC, you can try alternative ways to launch CMD. You can try launching Command Prompt from File Explorer or Task Manager. If that doesn't work, you can try running a System File Checker (SFC) scan to fix the corrupted system files and make CMD work.

Why is cmd not working Windows 10?

It is quite possible that Command Prompt is not opening in Windows 10 because there are corrupt system files. For this, you can take the aid of Windows PowerShell and run the SFC command to fix and detect missing or corrupt system files. After you have opened the Windows PowerShell (Admin) type SFC/scannow.


2 Answers

The issue ended up being a new feature of the windows 10 console. Under the default config, whenever you click on a command window in windows 10, it immediately halts the application process when it attempts to write to the console. When this happens, the command window has gone into "selection" mode.

You can tell it has happened because it will prefix the title bar of the command window with the word "Select" :

frozen command window

To get your program running again, you have to press escape or click somewhere else.

To get rid of this strange behavior, you can disable QuickEdit mode:

disable QuickEdit Mode

like image 145
Shaun Rowan Avatar answered Sep 28 '22 07:09

Shaun Rowan


What I'd like to add here to Shaun Rowan's answer is that for it to work in all console windows you have to click "Defaults", instead of "Properties" and make your changes there, as described in this post.

like image 42
iko79 Avatar answered Sep 28 '22 07:09

iko79