Skip to content

Exception resizing PWSH window while using up arrow to review past commands #3466

@DonFrazier

Description

@DonFrazier

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

Oops, something went wrong.
Please report this bug with ALL the details below, including both the 'Environment' and 'Exception' sections.
Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.md
Thank you!

### Environment
PSReadLine: 2.1.0
PowerShell: 7.2.7
OS: Microsoft Windows 10.0.22621
BufferWidth: 133
BufferHeight: 29

Last 82 Keys

 g d Enter
 c d Spacebar b i Tab s c e \ m Tab Tab Enter
 c d Spacebar r g _ w p Tab Enter
 g c i Enter
 r e m o v e - i t Tab Spacebar m i c Tab Tab Enter
 UpArrow Backspace Backspace Backspace Backspace Escape Enter
 Enter
 Enter
 Enter
 Enter
 Enter
 Enter
 Enter
 Enter
 g c i Enter
 g c i Enter
 r e m o v e - i t UpArrow Escape

Exception

System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension. (Parameter 'top')
Actual value was 29.
   at System.ConsolePal.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Render()
   at Microsoft.PowerShell.PSConsoleReadLine.RevertLine(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(PSKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)


### Screenshot

![image](https://user-images.githubusercontent.com/73557780/199222158-c452816e-a5a3-4e33-8850-cd6d054c9b25.png)


### Environment data

```console
PS Version: 7.2.7
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.1.0
PSReadLine EditMode: Windows
OS: 10.0.22621.1 (WinBuild.160101.0800)
BufferWidth: 133
BufferHeight: 29

Steps to reproduce

up arrow to start scrolling through previous commands
resize window width making it wider

Expected behavior

text to wrap around to fit new window width

Actual behavior

this exception

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-DuplicateThere's another issue on the tracker that's pretty much the same thing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions