question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PowerShell scrolling buffer in PSReadline incorrectly over SSH

See original GitHub issue

@iSazonov @lzybkr

As 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
MaximoTrinidadcommented, Jun 5, 2018

Repo steps should always be included:

  1. Open MacOs terminal session
  2. Create a remote connection using Enter-PSSession
  3. Then, set terminal session to full-screen.
  4. Use "dir"command to populate the screen with list of files.

At this point the issue shows when the cursor jumps to the middle of the screen. This is with PSReadline version 1.2

pwsh_cursorjump_2018-06-05_7-47-58

Installed PSReadline-Beta2 and the symptoms seems to be corrected:

pwsh_psreadbeta2_2018-06-05_7-47-58

0reactions
SteveL-MSFTcommented, Jun 6, 2018

@marekr seems like PSReadLine 2.0.0-beta2 (to be included with next PSCore6.1-Preview3 release) fixes your issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PowerShell Will Not Scroll Vertically - Here's the Fix
1. PowerShell buffer size. The default PowerShell buffer size allows users to scroll a few lines forward or back however, if your window...
Read more >
PowerShell Console Window Complaints
ConEmu supports 256 colours as long as buffer scrolling is turned off, which sucks, but you can choose to only disable it when...
Read more >
about PSReadLine Functions - PowerShell
This article documents the functions provided by PSReadLine. ... The input buffer is then passed to the PowerShell parser.
Read more >
Windows 10 - Powershell console, cannot vertically scroll
Does anyone know what I might need to do to fix this? I can't see any settings in powershell properties to enable or...
Read more >
Getting powershell current line before ENTER is pressed
I am using PowerShell Core 7.1.0 on the new Windows Terminal. PredictiveSource. It seems like PSReadLine's PredictiveSource option might be able ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found