Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose I run cmd.exe and ping localhost. After that I ping localhost again but I click into the window and the ping stops until I press enter.

What happens exactly when I click into the window? Does it suspend the process or something else? I attached a screenshot to clarify this issue.

Note: I do not actually click but drag using the mouse which creates a white box in the window as you can see on the screenshot.

Edit: further clarification: What I really wish to know is whether dragging the window halts the cmd process or not?

Edit: even more clarification: I know that I'm using Quick Edit and pressing enter copies the contents I selected. What I do not know is what happens in the background.

enter image description here

share|improve this question
up vote 15 down vote accepted

When you select some text in the cmd.exe window, the process will carry on in the background until the next time it writes to Standard Output (or STDOUT, the data stream which is shown in the cmd.exe window).

When you exit the selection mode, the process will resume as normal.

You can test this by typing ping -t into your cmd.exe window, and selecting some area of the output. You'll see it pause, and when you deselect the output will resume.

Edit: As per Fran's comment, you can use a tool such as Wireshark to see that activity does still happen after the point when you made the selection, and then stops.

share|improve this answer
That alone doesn't test it. You also need to run Wireshark and see if the ICMP packets stop getting sent. If so, you are right that the process is suspended. If not, the process is not suspended, and the output simply gets buffered (until the buffers fill up, then it will either be suspended or data will be lost). – Fran Aug 9 '12 at 17:27
I'm fairly sure @Fran is right - doesn't a whole bunch of output appear at once, if you waited long enough in selection mode? – Izkata Aug 9 '12 at 18:31
@Fran It's sufficient to detect that the process is paused at some point. I'll add your suggestion to the answer – JohnL Aug 9 '12 at 18:41
This annoyed me a lot, but I found out that if you go to properties of the cmd windows you can deselect "Quick edit mode" and you will not enter the select mode by clicking in the window. – Zitrax Jan 30 '15 at 9:13
@Zitrax yes that's how you can prevent this happening accidentally. I frequently copy things from my command window, so I don't do that. (well, actually I use Consolez which doesn't have that issue) – JohnL Jan 30 '15 at 18:11

Once you click into the Command Prompt window, the console host will no longer allow output to be written. The application itself keeps running, but nothing is written to the screen.

Of course, as long as there is only a single thread, this is basically the same thing as having your process frozen. As the single thread tries to write some output before doing more work.

If I run ping -t localhost and click into the command prompt window, I can then inspect the call stack of the main ping.exe thread with Process Explorer.

enter image description here

We can see that ping.exe tried to write some output. It called write() in the C runtime library. That function, at some point, calls GetConsoleMode. As it seems, that function will check if the user is currently in mark mode and block execution if needed.

Further Analysis

We can further proof this behavior by examining the behavior of ping with Wireshark

When running ping -t we see the following output in Wireshark:
enter image description here

Now, let's mark a box in the command prompt.
enter image description here
Suddenly, no more pings are logged in Wireshark. ping is no longer sending any packets.

But we already knew that...

Right, let's see if the output is actually the issue here! Let's direct the output to the NUL device:

enter image description here

Now, there is no longer any ouput. We can now mark text in the box all day long, packets will be logged in Wireshark.

enter image description here

share|improve this answer
Thanks for the stack trace. – Adam Arold Aug 9 '12 at 21:04
If I hadn't +1'd already for the original answer, I'd +1 now for the "Further analysis" – JohnL Aug 14 '12 at 21:44

That is because the window has entered Mark mode. When you press enter, it copies the selected text to the clipboard. To my knowledge, there is no setting for this, so I'm not sure why it's doing that when you just click into the window. Normally you have to right click and hit "Mark". Check to make sure no keys are stuck on your keyboard.

share|improve this answer
And what does "Mark mode" do? Does it suspend the process? – Adam Arold Aug 9 '12 at 16:33
Mark mode is used for copying text from the command window. AFAIK that is the only use, though I suppose there may be others. – Garrett Aug 9 '12 at 16:36
The setting is called Quick Edit Mode. Click the icon in the top left hand corner, choose Properties and Choose Quick Edit Mode on the Options tab. From what I know, the process will continue in the background until it needs to interact with the console, at which point it will block – JohnL Aug 9 '12 at 16:37
@JohnL please create an answer because your comment is what I'm looking for. – Adam Arold Aug 9 '12 at 16:41
@edem Added an answer :) – JohnL Aug 9 '12 at 16:58

Your CMD windows is in quick edit mode which automatically enter the edit mode when you click on the screen. The Enter is for copy the text in the white-box and exit the edit mode.

Normally CMD only enter edit mode when you right click on the black screen and choose Mark.

To change back to normal, right click on the title bar of the windows and choose Properties, select Options tab and deselect "Quick Edit Mode" and click ok.

share|improve this answer

When you are selecting the text to copy from the window (when in Mark mode) the system suspends the current process in that window.

Example batch file:

echo %0
goto test

when this is run, as soon as I mark the area to copy, the screen stops scrolling

share|improve this answer
I was about to post the exact same thing (except that my batch file was echo blah↵%0). :-) – Synetech Aug 9 '12 at 21:04

You must log in to answer this question.

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