@@ -197,7 +197,6 @@ internal static PSKeyInfo ReadKey()
197197 // - a key is pressed
198198 // - the console is exiting
199199 // - 300ms - to process events if we're idle
200- // - processing of events is requested externally
201200 // - ReadLine cancellation is requested externally
202201 handleId = WaitHandle . WaitAny ( _singleton . _requestKeyWaitHandles , 300 ) ;
203202 if ( handleId != WaitHandle . WaitTimeout && handleId != EventProcessingRequested )
@@ -650,10 +649,6 @@ private PSConsoleReadLine()
650649 _savedCurrentLine = new HistoryItem ( ) ;
651650 _queuedKeys = new Queue < PSKeyInfo > ( ) ;
652651
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-
657652 string hostName = null ;
658653 // This works mostly by luck - we're not doing anything to guarantee the constructor for our
659654 // singleton is called on a thread with a runspace, but it is happening by coincidence.
@@ -838,7 +833,7 @@ private void DelayedOneTimeInitialize()
838833 _singleton . _readKeyWaitHandle = new AutoResetEvent ( false ) ;
839834 _singleton . _keyReadWaitHandle = new AutoResetEvent ( false ) ;
840835 _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 } ;
842837 _singleton . _threadProcWaitHandles = new WaitHandle [ ] { _singleton . _readKeyWaitHandle , _singleton . _closingWaitHandle } ;
843838
844839 // This is for a "being hosted in an alternate appdomain scenario" (the
@@ -858,17 +853,6 @@ private void DelayedOneTimeInitialize()
858853 _singleton . _readKeyThread . Start ( ) ;
859854 }
860855
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-
872856 private static void Chord ( ConsoleKeyInfo ? key = null , object arg = null )
873857 {
874858 if ( ! key . HasValue )
0 commit comments