Windows command prompt freezing randomly

16

7

My Windows command prompt will randomly freeze up when running an Ant script. The script has no spots in it where it waits for user input.

Also, when it freezes I can unfreeze it by focusing the command window and pressing enter. After pressing enter, the process continues.

This happens completely randomly. And it seems like it will eventually continue on its on, but it will sit there for several minutes before continuing. But if I press enter, it does it instantly.

What is going on?

(Would this be better for Stack Overflow? I do not believe this has anything to do with my code, because there is no spot asking for user input. So i am assuming it has something to do with Windows.)

prolink007

Posted 2012-05-02T16:44:43.987

Reputation: 371

Answers

2

I may have found the issue. Through some trial and error it seems that when i click in the command prompt it freezes the console. When i press escape (to take the cursor out of the window) it unfreezes the console.

So, to avoid this problem, i just don't click in the windows command prompt window while anything is running.

prolink007

Posted 2012-05-02T16:44:43.987

Reputation: 371

1I believe it is a windows 10 thing, and has to do with the new "selection / copy" mode that it goes into. – Shaun Rowan – 2015-11-24T00:30:08.423

This has happened to me, too (in fact, I only found this question because I was typing one), but it has happened regardless of whether I have clicked in the window or not. To give you an example, I had a server that I started via the command line and then left running on a machine that didn't have any users. When accessing it, instructions would hang because the command prompt was "stuck" waiting for a keypress (exactly like your symptom). Seems few have had this problem, so there is no solution yet. – K. Carpenter – 2014-03-14T01:25:59.503

19

Disable the QuickEdit Mode and\or Insert option from the cmd properties. Problem solved

malanve

Posted 2012-05-02T16:44:43.987

Reputation: 191

2After a quick test this fixes the problem. An answer that actually fixes the problem. – Zergleb – 2016-04-06T07:48:16.463

is there any way to do this temporarily, like disable it at the start of a .cmd file, run my batch commands, then enable it again before it exits? – Adam.at.Epsilon – 2019-04-16T08:37:49.570

-1

I completely disagree that it has anything to do with Windows.

My reasoning is this: when you focus on the window and press Enter, it continues working.

There's a problem with your script, not Windows, and not the command prompt.

user3463

Posted 2012-05-02T16:44:43.987

Reputation:

1You are wrong. Please see my answer that is posted. – prolink007 – 2012-05-04T15:54:08.807

This is a user error, and I maintain that there is nothing wrong with Windows or the command prompt. – None – 2012-05-04T21:01:14.300

2It's a "feature", not a bug :-) – Aaron Blenkush – 2013-10-02T23:03:35.860