16

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.)

3 Answers 3

19

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

3
  • 2
    After a quick test this fixes the problem. An answer that actually fixes the problem.
    – Zergleb
    Apr 6, 2016 at 7:48
  • 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? Apr 16, 2019 at 8:37
  • this option also disables scrolling in windows 10 ubuntu WSL
    – PathToLife
    Jun 16, 2020 at 10:04
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.

3
  • 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. Mar 14, 2014 at 1:25
  • 1
    I believe it is a windows 10 thing, and has to do with the new "selection / copy" mode that it goes into. Nov 24, 2015 at 0:30
  • 2
-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.

3
  • 1
    You are wrong. Please see my answer that is posted.
    – prolink007
    May 4, 2012 at 15:54
  • This is a user error, and I maintain that there is nothing wrong with Windows or the command prompt.
    – user3463
    May 4, 2012 at 21:01
  • 2
    It's a "feature", not a bug :-) Oct 2, 2013 at 23:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .