@@ -198,7 +198,6 @@ internal static PSKeyInfo ReadKey()
198
198
// - a key is pressed
199
199
// - the console is exiting
200
200
// - 300ms - to process events if we're idle
201
- // - processing of events is requested externally
202
201
// - ReadLine cancellation is requested externally
203
202
handleId = WaitHandle . WaitAny ( _singleton . _requestKeyWaitHandles , 300 ) ;
204
203
if ( handleId != WaitHandle . WaitTimeout && handleId != EventProcessingRequested )
@@ -674,10 +673,6 @@ private PSConsoleReadLine()
674
673
_savedCurrentLine = new HistoryItem ( ) ;
675
674
_queuedKeys = new Queue < PSKeyInfo > ( ) ;
676
675
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
-
681
676
string hostName = null ;
682
677
// This works mostly by luck - we're not doing anything to guarantee the constructor for our
683
678
// singleton is called on a thread with a runspace, but it is happening by coincidence.
@@ -868,7 +863,7 @@ private void DelayedOneTimeInitialize()
868
863
_singleton . _readKeyWaitHandle = new AutoResetEvent ( false ) ;
869
864
_singleton . _keyReadWaitHandle = new AutoResetEvent ( false ) ;
870
865
_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 } ;
872
867
_singleton . _threadProcWaitHandles = new WaitHandle [ ] { _singleton . _readKeyWaitHandle , _singleton . _closingWaitHandle } ;
873
868
874
869
// This is for a "being hosted in an alternate appdomain scenario" (the
@@ -888,17 +883,6 @@ private void DelayedOneTimeInitialize()
888
883
_singleton . _readKeyThread . Start ( ) ;
889
884
}
890
885
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
-
902
886
private static void Chord ( ConsoleKeyInfo ? key = null , object arg = null )
903
887
{
904
888
if ( ! key . HasValue )
0 commit comments