File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
src/PowerShellEditorServices/Services/PowerShell/Host Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -617,17 +617,15 @@ private void DoOneRepl(CancellationToken cancellationToken)
617617
618618 // If the user input was empty it's because:
619619 // - the user provided no input
620- // - the readline task was canceled
621- // - CtrlC was sent to readline (which does not propagate a cancellation)
620+ // - the ReadLine task was canceled
621+ // - CtrlC was sent to ReadLine (which does not propagate a cancellation)
622622 //
623- // In any event there's nothing to run in PowerShell, so we just loop back to the prompt again.
624- // However, we must distinguish the last two scenarios, since PSRL will not print a new line in those cases.
625- if ( string . IsNullOrEmpty ( userInput ) )
623+ // In any event there's nothing to run in PowerShell, so we just loop back to the
624+ // prompt again. However, PSReadLine will not print a newline for CtrlC, so we print
625+ // one, but we do not want to print one if the ReadLine task was canceled.
626+ if ( string . IsNullOrEmpty ( userInput ) && LastKeyWasCtrlC ( ) )
626627 {
627- if ( cancellationToken . IsCancellationRequested || LastKeyWasCtrlC ( ) )
628- {
629- UI . WriteLine ( ) ;
630- }
628+ UI . WriteLine ( ) ;
631629 return ;
632630 }
633631
You can’t perform that action at this time.
0 commit comments