File tree 1 file changed +11
-3
lines changed
src/PowerShellEditorServices/Services/PowerShellContext
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)
1838
1838
/// <param name="e">details of the execution status change</param>
1839
1839
private void PowerShellContext_ExecutionStatusChangedAsync ( object sender , ExecutionStatusChangedEventArgs e )
1840
1840
{
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
+ }
1844
1852
}
1845
1853
1846
1854
#endregion
You can’t perform that action at this time.
0 commit comments