Skip to content

Commit 9078e71

Browse files
committed
Fix bug with console paste not displaying everything
1 parent a2cdea2 commit 9078e71

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

PSReadLine/ReadLine.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,12 @@ public static void AcceptLine(ConsoleKeyInfo? key = null, object arg = null)
625625

626626
// Make sure cursor is at the end before writing the line
627627
_singleton._current = _singleton._buffer.Length;
628+
if (_singleton._queuedKeys.Count > 0)
629+
{
630+
// If text was pasted, for performance reasons we skip rendering for some time,
631+
// but if input is accepted, we won't have another chance to render.
632+
_singleton.ReallyRender();
633+
}
628634
_singleton.PlaceCursor();
629635
Console.Out.Write("\n");
630636
_singleton._inputAccepted = true;
@@ -1695,6 +1701,11 @@ private void Render()
16951701
return;
16961702
}
16971703

1704+
ReallyRender();
1705+
}
1706+
1707+
private void ReallyRender()
1708+
{
16981709
_renderForDemoNeeded = false;
16991710

17001711
var text = ParseInput();

0 commit comments

Comments
 (0)