Skip to content

fix running indicator by ignoring PSRL aborts #1096

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1838,9 +1838,17 @@ public MinifiedRunspaceDetails(RunspaceDetails eventArgs)
/// <param name="e">details of the execution status change</param>
private void PowerShellContext_ExecutionStatusChangedAsync(object sender, ExecutionStatusChangedEventArgs e)
{
_languageServer?.SendNotification(
"powerShell/executionStatusChanged",
e);
// The cancelling of the prompt (PSReadLine) causes an ExecutionStatus.Aborted to be sent after every
// actual execution (ExecutionStatus.Running) on the pipeline. We ignore that event since it's counterintuitive to
// the goal of this method which is to send updates when the pipeline is actually running something.
// In the event that we don't know if it was a ReadLine cancel, we default to sending the notification.
var options = e?.ExecutionOptions;
if (options == null || !options.IsReadLine)
{
_languageServer?.SendNotification(
"powerShell/executionStatusChanged",
e);
}
}

#endregion
Expand Down