PowerShell / PSReadLine

A bash inspired readline implementation for PowerShell
BSD 2-Clause "Simplified" License
3.71k stars 295 forks source link

System.ArgumentOutOfRangeException when using PSReadLine in VS Code #4196

Closed superprogramer123 closed 2 days ago

superprogramer123 commented 6 days ago

Prerequisites

Exception report

I encountered a `System.ArgumentOutOfRangeException` while using PSReadLine in Visual Studio Code. The error message indicates that the value must be greater than or equal to zero and less than the console's buffer size. The actual value was -2.

Screenshot

Capture 3 2

Environment data

Psreadline version: PSReadline 2.0.0
powershell vesrion:Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      19041  4894
operating system details:CsName            : DESKTOP-618M4H9
OsName            : Microsoft Windows 10 Pro
OsArchitecture    : 64-bit
WindowsVersion    : 2009
WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406

Steps to reproduce

  1. Open Visual Studio Code.
  2. Open the integrated terminal.
  3. Click the play button to run the script.
  4. Observe the error message.

Expected behavior

the code runs without displaying error messages

Actual behavior

When I clicked the play button in VS Code, I received a System.ArgumentOutOfRangeException error. The error message indicated that the value must be greater than or equal to zero and less than the console's buffer size. The actual value was -2.