PSReadLine icon indicating copy to clipboard operation
PSReadLine copied to clipboard

uncaught exception when pressing PgUp/PgDn in bck-i-search

Open astraleureka opened this issue 1 year ago • 0 comments

Prerequisites

  • [X] Write a descriptive title.
  • [X] Make sure you are able to repro it on the latest released version
  • [X] Search the existing issues, especially the pinned issues.

Exception report

### Environment
PSReadLine: 2.3.5+2cc85806c561a9395751a96a818e8ff1592d19f7
PowerShell: 7.4.2
OS: Microsoft Windows 10.0.17763
BufferWidth: 282
BufferHeight: 9001

Last 4 Keys:

 LeftWindows Enter
 Ctrl+r PageDown

### Exception

System.IO.IOException: The parameter is incorrect.
   at System.ConsolePal.SetWindowPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.Internal.VirtualTerminal.SetWindowPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ScrollDisplayDown(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.4.2
PS HostName: ConsoleHost
PSReadLine Version: 2.3.5
PSReadLine EditMode: Windows
OS: 10.0.17763.1 (WinBuild.160101.0800)
BufferWidth: 282
BufferHeight: 9001

Steps to reproduce

Use bck-i-search (^R) and press PgUp/PgDn. No input to the search prompt is necessary, the exception is easily triggered. The same issue also occured in latest 7.2 release.

Expected behavior

The exception is caught or the keypress is otherwise ignored.

Actual behavior

Exception is thrown

astraleureka avatar Jun 07 '24 23:06 astraleureka