Display problem after Windows Terminal window scrolls with [console]::BufferHeight set larger than [console]::WindowHeight

Open
#4,875 16 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp, powershell

Research direction

No source file or test is named. Start by reproducing the issue in Windows Terminal with PS 7.5.2, PSReadLine 2.3.6, and the stated buffer dimensions, then trace the history-navigation and console-rendering entry points. Done means repeated function expansion and Up-Arrow navigation no longer produce incorrect history display or blank lines.

Written by the indexing model from the issue text.

Description

Needs-Attention :wave: Needs-Triage :mag:
Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.
Exception report
N/A
Screenshot

Screenshot showing problem

Image
Environment data
PS Version: 7.5.2
PS HostName: ConsoleHost
PSReadLine Version: 2.3.6
PSReadLine EditMode: Windows
OS: 10.0.26100.1 (WinBuild.160101.0800)
BufferWidth: 180
BufferHeight: 9001
Steps to reproduce

Repeatedly expanding a function and running it...
Paste the function 'alb' into PS. 'alb' commands to run it.
Paste the edited function into PS again. Up-Arrow, Up-Arrow, Enter to run the latest line which runs the function,
(I know, I need to re-write the function to use 'switch', but that wouldn't affect this problem.)

Expected behavior

The first Up-Arrow to display the function. The second should display the previous command, but doesn't. Hit Enter and there are blank lines in the window which shouldn't be there.

Actual behavior

The above behavior is seen.

Dominant language
C#
Stars
4.4k
Forks
341
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PowerShell/PSReadLine

All issues in PowerShell/PSReadLine

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.