File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ public partial class PSConsoleReadLine : IPSConsoleReadLineMockableMethods
4343 #pragma warning restore CS0649
4444
4545 private bool _delayedOneTimeInitCompleted ;
46+ // This is used by AIShell to check if PSReadLine is initialized and ready to render.
47+ private bool _readLineReady ;
4648
4749 private IPSConsoleReadLineMockableMethods _mockableMethods ;
4850 private IConsole _console ;
@@ -400,6 +402,7 @@ public static string ReadLine(
400402 _singleton . Initialize ( runspace , engineIntrinsics ) ;
401403 }
402404
405+ _singleton . _readLineReady = true ;
403406 _singleton . _cancelReadCancellationToken = cancellationToken ;
404407 return _singleton . InputLoop ( ) ;
405408 }
@@ -472,6 +475,8 @@ public static string ReadLine(
472475 }
473476 finally
474477 {
478+ _singleton . _readLineReady = false ;
479+
475480 try
476481 {
477482 // If we are closing, restoring the old console settings isn't needed,
You can’t perform that action at this time.
0 commit comments