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
20 changes: 19 additions & 1 deletion PSReadLine/Render.cs
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,25 @@ private void MoveCursor(int newCursor)
return;
}

_console.SetCursorPosition(point.X, point.Y);
if (point.Y == _console.BufferHeight)
{
// The cursor top exceeds the buffer height, so adjust the initial cursor
// position and the to-be-set cursor position for scrolling up the buffer.
_initialY -= 1;
point.Y -= 1;

// Insure the cursor is on the last line of the buffer prior
// to issuing a newline to scroll the buffer.
_console.SetCursorPosition(point.X, point.Y);

// Scroll up the buffer by 1 line.
_console.Write("\n");
}
else
{
_console.SetCursorPosition(point.X, point.Y);
}

_current = newCursor;
}

Expand Down