1

Why would a program that is run from the command line wait for user input (pressing Enter) if it wasn't programmed to do so?

I was using an AWS EC2 instance to run a computationally intensive program that does a few things including reading files, running computations on file contents and creating new files. For each of the tasks the program printed some debug info to stdout.

After going through a couple of steps it seemingly got stuck on a massive computation. The program hadn't advanced for too long and the resource use had dropped from the steady level when starting the step so I hit Enter out of frustration and it immediately proceeded.

  • I wasn't prompted for input
  • The author reassured me that an input pause wasn't in the source code
  • Given the facts a coincidence is very unlikely

Is this a system bug / quirk / feature?

Why could it happen and can I avoid this in the future?

5
  • Maybe a debug feature that the author of the program forgot to delete. Or it could be some other program that is invoked from the inside. It would take a scan of the source code to find out what.
    – harrymc
    Commented Jul 10, 2018 at 15:31
  • What @harrymc said. The developer should attempt to recreate your bug rather than simply dismissing this out of hand. Commented Jul 10, 2018 at 15:43
  • "The author reassured me that an input pause wasn't in the source code" - Apple said it wasn't possible to block the antenna on an older model of the iPhone until it actually happened, and they ended up redesigning the phone. The point, people lie, and sadly you can't confirm that is the case.
    – Ramhound
    Commented Jul 10, 2018 at 16:04
  • Is it not more likely that the command prompt was clicked on that suspended the output, the enter resumed it. As an example. If you open a command prompt and run something like ping www.google.com -t. If you click on the window it will pause output until you hit a key such as Enter. Commented Jul 10, 2018 at 19:17
  • @HelpingHand That sounds like a viable cause! I'll try to reproduce this the next time I have the chance. I think you can submit this as an answer, I'll accept it / give more feedback after I try it out.
    – George
    Commented Jul 10, 2018 at 19:38

1 Answer 1

2

Windows command prompt (cmd.exe) has a "quick edit" mode which is enabled by default.

Quick Edit Mode

With "quick edit" mode enabled, if you click on the command prompt while it is updating, E.g. in the case of running a command such as:

ping www.google.com -t

then updating the output will stop until a key is entered such as Enter in the case of the question.

1
  • 1
    Indeed this seems to have been the cause of my problem. I must have clicked the terminal window to see if it was still running and gotten into the quick edit mode.
    – George
    Commented Jul 11, 2018 at 13:36

You must log in to answer this question.

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