PowerShell scrolling buffer in PSReadline incorrectly over SSH
See original GitHub issueAs a followup to #4075
The next issue while remote use of Powershell seems to be calculating the wrong locations to move cursors on wrap around:
I recorded a video showing split console with one showing the visual usage of powershell and the other one of a log file dumped
https://www.youtube.com/watch?v=_2LBAzFDsCk
You can see: when I execute a command that would exceed the current screen, it fails to scroll and “wraps”. Once its wrapped, it begins to start jumping the cursor around. In fact, hitting Enter on empty line stops creating blank prompts altogether.
The log file was a quick hack in WriteBufferLines
System.IO.File.AppendAllText(@"/home/mroszko/pstest/PowerShell/test.log", String.Format("top:{0},blc:{1},$
if ((top + bufferLineCount) > Console.BufferHeight)
{
var scrollCount = (top + bufferLineCount) - Console.BufferHeight;
ScrollBuffer(scrollCount);
top -= scrollCount;
System.IO.File.AppendAllText(@"/home/mroszko/pstest/PowerShell/test.log", String.Format("scrolling:{0$
}
I started the video by executing “clear” before
You can see the strange wrap around it does in the video with top as I type in the log output and visually.
I don’t think the ScrollBuffer() is quite implemented correct.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (2 by maintainers)

Top Related StackOverflow Question
Repo steps should always be included:
At this point the issue shows when the cursor jumps to the middle of the screen. This is with PSReadline version 1.2
Installed PSReadline-Beta2 and the symptoms seems to be corrected:
@marekr seems like PSReadLine 2.0.0-beta2 (to be included with next PSCore6.1-Preview3 release) fixes your issue.