@@ -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 )
@@ -650,10 +649,6 @@ private PSConsoleReadLine()
650
649
_savedCurrentLine = new HistoryItem ( ) ;
651
650
_queuedKeys = new Queue < PSKeyInfo > ( ) ;
652
651
653
- // Initialize this event handler early because it could be used by PowerShell
654
- // Editor Services before 'DelayedOneTimeInitialize' runs.
655
- _forceEventWaitHandle = new AutoResetEvent ( false ) ;
656
-
657
652
string hostName = null ;
658
653
// This works mostly by luck - we're not doing anything to guarantee the constructor for our
659
654
// singleton is called on a thread with a runspace, but it is happening by coincidence.
@@ -838,7 +833,7 @@ private void DelayedOneTimeInitialize()
838
833
_singleton . _readKeyWaitHandle = new AutoResetEvent ( false ) ;
839
834
_singleton . _keyReadWaitHandle = new AutoResetEvent ( false ) ;
840
835
_singleton . _closingWaitHandle = new ManualResetEvent ( false ) ;
841
- _singleton . _requestKeyWaitHandles = new WaitHandle [ ] { _singleton . _keyReadWaitHandle , _singleton . _closingWaitHandle , _defaultCancellationToken . WaitHandle , _singleton . _forceEventWaitHandle } ;
836
+ _singleton . _requestKeyWaitHandles = new WaitHandle [ ] { _singleton . _keyReadWaitHandle , _singleton . _closingWaitHandle , _defaultCancellationToken . WaitHandle } ;
842
837
_singleton . _threadProcWaitHandles = new WaitHandle [ ] { _singleton . _readKeyWaitHandle , _singleton . _closingWaitHandle } ;
843
838
844
839
// This is for a "being hosted in an alternate appdomain scenario" (the
@@ -858,17 +853,6 @@ private void DelayedOneTimeInitialize()
858
853
_singleton . _readKeyThread . Start ( ) ;
859
854
}
860
855
861
- /// <summary>
862
- /// Used by PowerShellEditorServices to force immediate
863
- /// event handling during the <see cref="PSConsoleReadLine.ReadKey" />
864
- /// method. This is not a public API, but it is part of a private contract
865
- /// with that project.
866
- /// </summary>
867
- private static void ForcePSEventHandling ( )
868
- {
869
- _singleton . _forceEventWaitHandle . Set ( ) ;
870
- }
871
-
872
856
private static void Chord ( ConsoleKeyInfo ? key = null , object arg = null )
873
857
{
874
858
if ( ! key . HasValue )
0 commit comments