Repository navigation
ArgumentOutOfRangeException when console BufferHeight == 1 (PowerShell 7.5.3 on Windows) #4927
Copy link
Copy link
Closed
Labels
Needs-Author FeedbackNeeds-ReproThere is no sufficient information on repro steps.There is no sufficient information on repro steps.Needs-Triage 🔍It's a new issue that core contributor team needs to triage.It's a new issue that core contributor team needs to triage.
Description
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.yaml
Thank you!
### Environment
PSReadLine: 2.3.6+d2e770f93b7a53d8660a6402eb29d1ae1c35e767
PowerShell: 7.5.3
OS: Microsoft Windows 10.0.26100
BufferWidth: 108
BufferHeight: 1
Last 88 Keys:
r m Spacebar - r f Spacebar . n e x t Enter
R e m o v e - I t e m Spacebar - R e c u r s e Spacebar - F o r c e Spacebar . n e x t Enter
R e m o v e - I t e m Spacebar - R e c u r s e Spacebar - F o r c e Spacebar n o d e _ m o d u l e s Enter
### 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 1.
at System.ConsolePal.SetCursorPosition(Int32 left, Int32 top)
at Microsoft.PowerShell.Internal.VirtualTerminal.SetCursorPosition(Int32 left, Int32 top)
at Microsoft.PowerShell.PSConsoleReadLine.CalculateWhereAndWhatToRender(Boolean cursorMovedToInitialPos, RenderData renderData, LineInfoForRendering& lineInfoForRendering)
at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
at Microsoft.PowerShell.PSConsoleReadLine.Render()
at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(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, Nullable`1 lastRunStatus)Screenshot
N/A
Environment data
PS Version: 7.5.3
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.3.6
PSReadLine EditMode: Windows
OS: Microsoft Windows 10.0.26100
BufferWidth: 108
BufferHeight: 1Steps to reproduce
Grok code in Cursor was deleting node modules
Expected behavior
PSReadLine should render normally, or gracefully handle when BufferHeight is extremely small.
Actual behavior
System.ArgumentOutOfRangeException is thrown on keypress when BufferHeight == 1.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs-Author FeedbackNeeds-ReproThere is no sufficient information on repro steps.There is no sufficient information on repro steps.Needs-Triage 🔍It's a new issue that core contributor team needs to triage.It's a new issue that core contributor team needs to triage.
Activity
daxian-dbw commentedon Sep 15, 2025
Cursor is not a supported platform. Can you please provide the reproduce steps using Windows Terminal? You can adjust the Windows Terminal's buffer height to 1.
microsoft-github-policy-service commentedon Sep 23, 2025
This issue is closed because it has been marked as requiring author feedback but has not had any activity for 7 days. If you think the issue is still relevant, please reopen and provide your feedback.
microsoft-github-policy-service commentedon Sep 23, 2025
This issue is closed because it has been marked as requiring repro steps but has not had any activity for 7 days. If you think the issue is still relevant, please reopen and provide your feedback.