Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does highlighting text in a command prompt window stop script execution or just prevent output? [duplicate]

Tags:

cmd

If you have ever tried highlighting text in a command prompt window while a script is running that is outputting text, you'll notice that it no longer outputs text.

My question is if the highlighting inside a cmd window simply prevents it from outputting text, but still allows the script to run, or if it halts the execution of the script while highlighted?

Regardless of the answer, it would also be nice to know why it does this? Both the reason and purpose would be great.

Thanks

like image 875
Recessive Avatar asked Feb 10 '19 22:02

Recessive


People also ask

How do I stop a command line execution?

Then we hit Ctrl+C to terminate the execution.

Can you run scripts from within the command window?

To run a script with a debugger At the command prompt, type cscript //d followed by the name of the script, and then press ENTER.

What is Quick Edit mode in Command Prompt?

Quick Edit mode is a Microsoft Windows feature which allows the user to select text (click and drag the mouse across the desired text) using the mouse in the Command Prompt window.

How do I pass a command line argument in Command Prompt?

To pass command line arguments, we typically define main() with two arguments : first argument is the number of command line arguments and second is list of command-line arguments.


1 Answers

This is done to allow you to make the selection. Otherwise, new output could scroll everything and you would end up not selecting what you wanted.

Only output is suspended. The program will continue executing, however if it uses unbuffered IO, or the buffer it uses is full, it will block on a write call until the selection is done.

like image 155
ᅙᄉᅙ Avatar answered Oct 06 '22 00:10

ᅙᄉᅙ