148

Periodically I notice PowerShell seems to take forever to finish doing whatever it is I told it to do until it occurs to me to "wake it up" by pressing enter. This is not the fault of any one process as best I can tell, as I have even run custom apps that just log their output to the screen every few seconds and even in these cases, PowerShell will stop doing anything after a while until I "give it a kick" by pressing enter.

Any ideas what might be causing this?

Nathan Ridley
  • 2,519
  • 3
  • 19
  • 18

2 Answers2

186

If the QuickEdit Mode and\or Insert options are checked within the console\window properties, and you click within the console, it will pause the output. If those options are not checked, the output can't be paused by clicking within the console.

alt text To get to these settings, right-click on the PowerShell-Logo in the top-left of your terminal window, then select 'Properties' (at least that's one way to do it)

CurtM
  • 2,870
  • 1
  • 16
  • 11
  • 11
    Ah, yes, it never occurred to me that clicking the screen could interrupt the output. After running some tests, this indeed seems to be the issue. – Nathan Ridley Nov 25 '10 at 14:37
  • Glad I could help. – CurtM Nov 25 '10 at 16:55
  • You are my hero! – willem Jul 17 '14 at 12:35
  • 11
    OMG Shell fail. – meawoppl Nov 24 '14 at 20:41
  • 23
    That is extremely annoying :) Another undocumented feature? –  Mar 03 '15 at 23:44
  • 11
    literally joined server fault to upvote, been years since i observed it first time, but it never became problem big enough to look into, until today i stepped on this 'rake' again :) – drk Aug 14 '15 at 13:16
  • This same issue (and solution) apply for the CMD terminal in Windows as well. http://stackoverflow.com/questions/30418886/how-and-why-does-quickedit-mode-in-command-prompt-freeze-applications – Tim D Feb 15 '17 at 17:00
  • 12
    Like drk, I joined this site to upvote :D. This solved one of the most annoying mysteries in my life lol. – Jan Apr 07 '17 at 12:09
  • 1
    Another hilariously ill-conceived and undocumented misfeature. Microsoft never ceases to both irritate and amaze me. – dr_ Dec 13 '17 at 14:12
  • How annoying. I wonder who thought this was a good default behaviour >:( – easuter Jan 10 '18 at 13:23
  • 1
    Annoying, but so useful at the same time. OMG, how often I tried copying some error's, and missed it due to fast terminal updates. – s.meijer Jan 19 '18 at 09:40
  • I posted a similar question on SO, thinking it was Python's fault. But somebody directed me here, and this was the answer I sought. Thanks! – Christofer Ohlsson Feb 11 '18 at 10:23
  • 1
    Just joined this site to upvote. I thought it was some threading issue in my code! LOL – Zhen Liu Apr 17 '19 at 17:39
  • I'm aware of the left click issue, but I have a system pausing where it stops hanging a few minutes after the window loses focus. It's very odd. And only on one computer, the rest are fine. – Brain2000 Jul 13 '19 at 02:18
  • 1
    @s.meijer it's true this behavior is a solution to the problem of output scrolling past. however a much less invasive solution would seem to be to halt just the _scrolling_ rather than the actual execution. – orion elenzil Nov 08 '19 at 20:18
  • @CurtM if i could i would buy you a case of beer. this is the DUMBEST "feature" i have ever heard of. just like the other commenters it happened randomly and i figured it was just a bug. christ the MS logic is just baffling to include something so asinine, let alone to do so without documenting it. – vampiire Jun 11 '20 at 23:06
  • Thanks so much for the answer. Note: actually, pressing any character (not only "Enter") will unpause the execution. – andreyk2 Hohlov Apr 21 '21 at 19:09
1

If you are running PowerShell script from within Cygwin like so:

powershell.exe -Command '<...>'

and you get this problem, you can fix it by piping in a newline:

echo | powershell.exe -Command '<...>'
cjfp
  • 21
  • 1