Skip to content

Commit 9cf04b0

Browse files
committed
Remove PSES force event handling hook
1 parent 81d31e0 commit 9cf04b0

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

PSReadLine/ReadLine.cs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ internal static PSKeyInfo ReadKey()
198198
// - a key is pressed
199199
// - the console is exiting
200200
// - 300ms - to process events if we're idle
201-
// - processing of events is requested externally
202201
// - ReadLine cancellation is requested externally
203202
handleId = WaitHandle.WaitAny(_singleton._requestKeyWaitHandles, 300);
204203
if (handleId != WaitHandle.WaitTimeout && handleId != EventProcessingRequested)
@@ -674,10 +673,6 @@ private PSConsoleReadLine()
674673
_savedCurrentLine = new HistoryItem();
675674
_queuedKeys = new Queue<PSKeyInfo>();
676675

677-
// Initialize this event handler early because it could be used by PowerShell
678-
// Editor Services before 'DelayedOneTimeInitialize' runs.
679-
_forceEventWaitHandle = new AutoResetEvent(false);
680-
681676
string hostName = null;
682677
// This works mostly by luck - we're not doing anything to guarantee the constructor for our
683678
// singleton is called on a thread with a runspace, but it is happening by coincidence.
@@ -868,7 +863,7 @@ private void DelayedOneTimeInitialize()
868863
_singleton._readKeyWaitHandle = new AutoResetEvent(false);
869864
_singleton._keyReadWaitHandle = new AutoResetEvent(false);
870865
_singleton._closingWaitHandle = new ManualResetEvent(false);
871-
_singleton._requestKeyWaitHandles = new WaitHandle[] {_singleton._keyReadWaitHandle, _singleton._closingWaitHandle, _defaultCancellationToken.WaitHandle, _singleton._forceEventWaitHandle};
866+
_singleton._requestKeyWaitHandles = new WaitHandle[] {_singleton._keyReadWaitHandle, _singleton._closingWaitHandle, _defaultCancellationToken.WaitHandle};
872867
_singleton._threadProcWaitHandles = new WaitHandle[] {_singleton._readKeyWaitHandle, _singleton._closingWaitHandle};
873868

874869
// This is for a "being hosted in an alternate appdomain scenario" (the
@@ -888,17 +883,6 @@ private void DelayedOneTimeInitialize()
888883
_singleton._readKeyThread.Start();
889884
}
890885

891-
/// <summary>
892-
/// Used by PowerShellEditorServices to force immediate
893-
/// event handling during the <see cref="PSConsoleReadLine.ReadKey" />
894-
/// method. This is not a public API, but it is part of a private contract
895-
/// with that project.
896-
/// </summary>
897-
private static void ForcePSEventHandling()
898-
{
899-
_singleton._forceEventWaitHandle.Set();
900-
}
901-
902886
private static void Chord(ConsoleKeyInfo? key = null, object arg = null)
903887
{
904888
if (!key.HasValue)

0 commit comments

Comments
 (0)