Bug Report (Pressing the up button gave this exception) #4217

Closed
opened 2026-01-30 23:41:13 +00:00 by claunia · 8 comments
Owner

Originally created by @thekeviv on GitHub (Oct 2, 2019).

Last 1 Keys: UpArrow 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 name: top Actual value was -1. at System.Console.SetCursorPosition(Int32 left, Int32 top) at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor) at Microsoft.PowerShell.PSConsoleReadLine.ForceRender() at Microsoft.PowerShell.PSConsoleReadLine.HistoryRecall(Int32 direction) at Microsoft.PowerShell.PSConsoleReadLine.PreviousHistory(Nullable1 key, Object arg) at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary2 dispatchTable, Boolean ignoreIfNoAction, Object arg) at Microsoft.PowerShell.PSConsoleReadLine.InputLoop() at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

Originally created by @thekeviv on GitHub (Oct 2, 2019). Last 1 Keys: UpArrow 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 name: top Actual value was -1. at System.Console.SetCursorPosition(Int32 left, Int32 top) at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor) at Microsoft.PowerShell.PSConsoleReadLine.ForceRender() at Microsoft.PowerShell.PSConsoleReadLine.HistoryRecall(Int32 direction) at Microsoft.PowerShell.PSConsoleReadLine.PreviousHistory(Nullable`1 key, Object arg) at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg) at Microsoft.PowerShell.PSConsoleReadLine.InputLoop() at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
Author
Owner

@zadjii-msft commented on GitHub (Oct 2, 2019):

  • Is this in the Windows Terminal, or conhost.exe (the legacy console, from launching powershell.exe directly)?
  • If in the Windows Terminal, what version?
  • What version of powershell are you using?
  • What version of PsReadline do you have?
  • Did you execute any commands prior to this?
@zadjii-msft commented on GitHub (Oct 2, 2019): * Is this in the Windows Terminal, or conhost.exe (the legacy console, from launching powershell.exe directly)? * If in the Windows Terminal, what version? * What version of powershell are you using? * What version of PsReadline do you have? * Did you execute any commands prior to this?
Author
Owner

@thekeviv commented on GitHub (Oct 2, 2019):

Is this in the Windows Terminal, or conhost.exe (the legacy console, from launching powershell.exe directly)? - Windows Terminal
If in the Windows Terminal, what version? - 0.5.2681.0
What version of powershell are you using? - 5.1.18362.145
What version of PsReadline do you have? - How to find that?
Did you execute any commands prior to this? - Just pressed the up button and this error occurred

@thekeviv commented on GitHub (Oct 2, 2019): Is this in the Windows Terminal, or conhost.exe (the legacy console, from launching powershell.exe directly)? - **Windows Terminal** If in the Windows Terminal, what version? - **0.5.2681.0** What version of powershell are you using? - **5.1.18362.145** What version of PsReadline do you have? - **How to find that?** Did you execute any commands prior to this? - **Just pressed the up button and this error occurred**
Author
Owner

@zadjii-msft commented on GitHub (Oct 2, 2019):

@thekeviv try a Get-Module PSReadline.

cc @stevel-msft @lzybkr

@zadjii-msft commented on GitHub (Oct 2, 2019): @thekeviv try a `Get-Module PSReadline`. cc @stevel-msft @lzybkr
Author
Owner

@thekeviv commented on GitHub (Oct 2, 2019):

PSReadLine version 2.0.0

@thekeviv commented on GitHub (Oct 2, 2019): PSReadLine version 2.0.0
Author
Owner

@zadjii-msft commented on GitHub (Oct 2, 2019):

Lastly, does this repro in conhost (powershell.exe) directly, w/o the Windows Terminal?

@zadjii-msft commented on GitHub (Oct 2, 2019): Lastly, does this repro in conhost (powershell.exe) directly, w/o the Windows Terminal?
Author
Owner

@SteveL-MSFT commented on GitHub (Oct 2, 2019):

@thekeviv can you install latest beta of PSReadLine 2.0.0? It fixes a number of these types of issues:

install-module psreadline -allowprerelease

If you still have problems after installing beta5, please open an issue here: https://github.com/powershell/psreadline

@SteveL-MSFT commented on GitHub (Oct 2, 2019): @thekeviv can you install latest beta of PSReadLine 2.0.0? It fixes a number of these types of issues: ```powershell install-module psreadline -allowprerelease ``` If you still have problems after installing beta5, please open an issue here: https://github.com/powershell/psreadline
Author
Owner

@thekeviv commented on GitHub (Oct 2, 2019):

Hi, The issue seems to occur sometimes and not always. For instance, even without installing this, it isn't occurring now. I have installed it for now and will post here again if it occurs again. Also, it seems to be occurring only with Powershell and not other shells although again due to the issue appearing and disappearing, it's possible I might just have been lucky in the other shells!

@thekeviv commented on GitHub (Oct 2, 2019): Hi, The issue seems to occur sometimes and not always. For instance, even without installing this, it isn't occurring now. I have installed it for now and will post here again if it occurs again. Also, it seems to be occurring only with Powershell and not other shells although again due to the issue appearing and disappearing, it's possible I might just have been lucky in the other shells!
Author
Owner

@zadjii-msft commented on GitHub (Oct 3, 2019):

@thekeviv that makes sense it wouldn't repro in other shells as well, since the error looks like it's actually coming from PSReadline:

...
at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()    
at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
...

If this is continuing to happen, I'd follow @SteveL-MSFT's advice and follow up on the PSReadline repo directly :)
Thanks!

@zadjii-msft commented on GitHub (Oct 3, 2019): @thekeviv that makes sense it wouldn't repro in other shells as well, since the error looks like it's actually coming from PSReadline: ``` ... at Microsoft.PowerShell.PSConsoleReadLine.InputLoop() at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics) ... ``` If this is continuing to happen, I'd follow @SteveL-MSFT's advice and follow up on the PSReadline repo directly :) Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4217