File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
src/PowerShellEditorServices/Services/PowerShellContext Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -1838,9 +1838,17 @@ public MinifiedRunspaceDetails(RunspaceDetails eventArgs)
18381838 /// <param name="e">details of the execution status change</param>
18391839 private void PowerShellContext_ExecutionStatusChangedAsync ( object sender , ExecutionStatusChangedEventArgs e )
18401840 {
1841- _languageServer ? . SendNotification (
1842- "powerShell/executionStatusChanged" ,
1843- e ) ;
1841+ // The cancelling of the prompt (PSReadLine) causes an ExecutionStatus.Aborted to be sent after every
1842+ // actual execution (ExecutionStatus.Running) on the pipeline. We ignore that event since it's counterintuitive to
1843+ // the goal of this method which is to send updates when the pipeline is actually running something.
1844+ // In the event that we don't know if it was a ReadLine cancel, we default to sending the notification.
1845+ var options = e ? . ExecutionOptions ;
1846+ if ( options == null || ! options . IsReadLine )
1847+ {
1848+ _languageServer ? . SendNotification (
1849+ "powerShell/executionStatusChanged" ,
1850+ e ) ;
1851+ }
18441852 }
18451853
18461854 #endregion
You can’t perform that action at this time.
0 commit comments