microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.27k stars 8.27k forks source link

Clicking on the console window blocks output #34

Closed fabio-muramatsu closed 6 years ago

fabio-muramatsu commented 7 years ago

Windows version: 10.0.15063

What I'm doing I've noticed that, if I click anywhere in the console window while a command is running, it seems to be blocked until I press some key to undo the mouse selection. I can reproduce it using the NodeJS REPL:

  1. Open nodejs and type in a command that prints something after an interval, for instance setTimeout(() => console.log("Done"), 2000);
  2. After pressing enter and before the timeout elapses, click somewhere in the console window, selecting a "unit cell" in the console
  3. While this "cell" is selected by this mouse click, the output is not printed to the screen, as if the command has been blocked
  4. If I press a key on the keyboard, the mouse selection is undone, and the output is printed

What should happen Clicking on the console window should not block the output from programs already running in the console. I have faced this problem with a webserver using Express and with MongoDB. Sometimes, when debugging, I accidentally clicked on the console window, preventing requests to the webserver and database from being processed. Once I press a key to undo the mouse click selection, the request is served. In my case, I was always using stdout (printing logs), so I guess execution is being blocked until the program can write to the console.

This behavior does not happen using Bash on Linux, so I suppose it's not by design. Any help would be appreciated. Thanks in advance.

khouzam commented 6 years ago

Hi @fabio-muramatsu,

This is indeed by design when you have QuickEdit mode selected. If you want to get the behavior that you're looking for, you can turn off QuickEdit and clicking in the window will not block output to the window. One of the reasons behind this behavior is that QuickEdit allows you to quickly select a region of the console to copy the text from, it would be very hard to have that happen if the buffer is scrolling at the same time.

We understand that not everyone wants this behavior, that is why there is the option to change it.

Thanks ~Gilles

fabio-muramatsu commented 6 years ago

Hi @khouzam. Thanks for the response. Personally, though, I would prefer that Quick Edit allowed selecting text to copy (which is very useful indeed) without blocking the output, which better aligns the console behavior with bash. But I get your point. Since this is not a bug, I guess this issue can be closed. Thank you again for your attention.