File tree 1 file changed +5
-3
lines changed 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,9 @@ public partial class PSConsoleReadLine : IPSConsoleReadLineMockableMethods
44
44
45
45
private static readonly CancellationToken _defaultCancellationToken = new CancellationTokenSource ( ) . Token ;
46
46
47
- private static Action _handleIdleOverride ;
47
+ // This exists for PowerShell Editor Services (the backend of the PowerShell VSCode extension)
48
+ // so that it can call PSReadLine from a delegate and not hit nested pipeline issues
49
+ private static Action < CancellationToken > _handleIdleOverride ;
48
50
49
51
private bool _delayedOneTimeInitCompleted ;
50
52
@@ -203,9 +205,9 @@ internal static PSKeyInfo ReadKey()
203
205
if ( handleId != WaitHandle . WaitTimeout && handleId != EventProcessingRequested )
204
206
break ;
205
207
206
- if ( _handleIdleOverride != null )
208
+ if ( _handleIdleOverride is not null )
207
209
{
208
- _handleIdleOverride ( ) ;
210
+ _handleIdleOverride ( _singleton . _cancelReadCancellationToken ) ;
209
211
continue ;
210
212
}
211
213
You can’t perform that action at this time.
0 commit comments