Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions PSReadLine/ReadLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public partial class PSConsoleReadLine : IPSConsoleReadLineMockableMethods
#pragma warning restore CS0649

private bool _delayedOneTimeInitCompleted;
// This is used by AIShell to check if PSReadLine is initialized and ready to render.
private bool _readLineReady;

private IPSConsoleReadLineMockableMethods _mockableMethods;
private IConsole _console;
Expand Down Expand Up @@ -400,6 +402,7 @@ public static string ReadLine(
_singleton.Initialize(runspace, engineIntrinsics);
}

_singleton._readLineReady = true;
_singleton._cancelReadCancellationToken = cancellationToken;
return _singleton.InputLoop();
}
Expand Down Expand Up @@ -472,6 +475,8 @@ public static string ReadLine(
}
finally
{
_singleton._readLineReady = false;

try
{
// If we are closing, restoring the old console settings isn't needed,
Expand Down