Skip to content

Commit e4730a1

Browse files
committed
Improve artificial idle event comment
1 parent ec85f59 commit e4730a1

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
@@ -681,9 +681,9 @@ private void OnPowerShellIdle()
681681

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

0 commit comments

Comments
 (0)