Skip to content

Commit d779a73

Browse files
committed
Improve artificial idle event comment
1 parent ef5595b commit d779a73

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,9 +683,9 @@ private void OnPowerShellIdle()
683683

684684
if (string.Equals(subscriber.SourceIdentifier, PSEngineEvent.OnIdle, StringComparison.OrdinalIgnoreCase))
685685
{
686-
// PowerShell thinks we're in a call (the ReadLine call) rather than idle,
687-
// but we know we're sitting in the prompt.
688-
// So we need to generate the idle event ourselves
686+
// We control the pipeline thread, so it's not possible for PowerShell to generate events while we're here.
687+
// But we know we're sitting waiting for the prompt, so we generate the idle event ourselves
688+
// and that will flush idle event subscribers in PowerShell so we can service them
689689
_mainRunspaceEngineIntrinsics.Events.GenerateEvent(PSEngineEvent.OnIdle, sender: null, args: null, extraData: null);
690690
break;
691691
}

0 commit comments

Comments
 (0)