@@ -197,7 +197,6 @@ internal static PSKeyInfo ReadKey()
197
197
// - a key is pressed
198
198
// - the console is exiting
199
199
// - 300ms - to process events if we're idle
200
- // - processing of events is requested externally
201
200
// - ReadLine cancellation is requested externally
202
201
handleId = WaitHandle . WaitAny ( _singleton . _requestKeyWaitHandles , 300 ) ;
203
202
if ( handleId != WaitHandle . WaitTimeout && handleId != EventProcessingRequested )
@@ -655,10 +654,6 @@ private PSConsoleReadLine()
655
654
_savedCurrentLine = new HistoryItem ( ) ;
656
655
_queuedKeys = new Queue < PSKeyInfo > ( ) ;
657
656
658
- // Initialize this event handler early because it could be used by PowerShell
659
- // Editor Services before 'DelayedOneTimeInitialize' runs.
660
- _forceEventWaitHandle = new AutoResetEvent ( false ) ;
661
-
662
657
string hostName = null ;
663
658
// This works mostly by luck - we're not doing anything to guarantee the constructor for our
664
659
// singleton is called on a thread with a runspace, but it is happening by coincidence.
@@ -849,7 +844,7 @@ private void DelayedOneTimeInitialize()
849
844
_singleton . _readKeyWaitHandle = new AutoResetEvent ( false ) ;
850
845
_singleton . _keyReadWaitHandle = new AutoResetEvent ( false ) ;
851
846
_singleton . _closingWaitHandle = new ManualResetEvent ( false ) ;
852
- _singleton . _requestKeyWaitHandles = new WaitHandle [ ] { _singleton . _keyReadWaitHandle , _singleton . _closingWaitHandle , _defaultCancellationToken . WaitHandle , _singleton . _forceEventWaitHandle } ;
847
+ _singleton . _requestKeyWaitHandles = new WaitHandle [ ] { _singleton . _keyReadWaitHandle , _singleton . _closingWaitHandle , _defaultCancellationToken . WaitHandle } ;
853
848
_singleton . _threadProcWaitHandles = new WaitHandle [ ] { _singleton . _readKeyWaitHandle , _singleton . _closingWaitHandle } ;
854
849
855
850
// This is for a "being hosted in an alternate appdomain scenario" (the
@@ -869,17 +864,6 @@ private void DelayedOneTimeInitialize()
869
864
_singleton . _readKeyThread . Start ( ) ;
870
865
}
871
866
872
- /// <summary>
873
- /// Used by PowerShellEditorServices to force immediate
874
- /// event handling during the <see cref="PSConsoleReadLine.ReadKey" />
875
- /// method. This is not a public API, but it is part of a private contract
876
- /// with that project.
877
- /// </summary>
878
- private static void ForcePSEventHandling ( )
879
- {
880
- _singleton . _forceEventWaitHandle . Set ( ) ;
881
- }
882
-
883
867
private static void Chord ( ConsoleKeyInfo ? key = null , object arg = null )
884
868
{
885
869
if ( ! key . HasValue )
0 commit comments