PSReadLine icon indicating copy to clipboard operation
PSReadLine copied to clipboard

issue in powershell opening in vscode terminal (in secondary sidebar)

Open traumasv opened this issue 1 year ago • 2 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

Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new
### Environment
PSReadLine: 2.0.0
PowerShell: 5.1.26100.4202
OS: Microsoft Windows 10.0.26100
Last 200 Keys

 p o r a r y Spacebar t r a n s f o r m e r Spacebar w e i g h t s Spacebar f o r Spacebar a u g Backspace t o r e g r e s s i v e Spacebar e v a l u a t i o n ' Enter
 g i t Spacebar p u s h Spacebar o r i g i n Spacebar m a i n Enter
 p y h o Backspace Backspace t h o n Spacebar r u n _ p i p e l i n e Tab Enter
 Ctrl+a Ctrl+d DownArrow Escape p y t h o n Spacebar r u n Tab Spacebar - - u s - Backspace e - p p o - m o d e l s Spacebar . / p p o Tab Backspace Backspace Backspace Backspace Backspace Backspace m o d e l s Tab p p o Tab Spacebar . \ m o d e l s Tab p p o Tab Tab Spacebar . \ m o d e l s Tab p p o Tab Tab Tab Enter
 UpArrow DownArrow UpArrow 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 35.
   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(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

N/A

Environment data

PSReadLine: 2.0.0
PowerShell: 5.1.26100.4202
OS: Microsoft Windows 10.0.26100
Last 200 Keys

 p o r a r y Spacebar t r a n s f o r m e r Spacebar w e i g h t s Spacebar f o r Spacebar a u g Backspace t o r e g r e s s i v e Spacebar e v a l u a t i o n ' Enter
 g i t Spacebar p u s h Spacebar o r i g i n Spacebar m a i n Enter
 p y h o Backspace Backspace t h o n Spacebar r u n _ p i p e l i n e Tab Enter
 Ctrl+a Ctrl+d DownArrow Escape p y t h o n Spacebar r u n Tab Spacebar - - u s - Backspace e - p p o - m o d e l s Spacebar . / p p o Tab Backspace Backspace Backspace Backspace Backspace Backspace m o d e l s Tab p p o Tab Spacebar . \ m o d e l s Tab p p o Tab Tab Spacebar . \ m o d e l s Tab p p o Tab Tab Tab Enter
 UpArrow DownArrow UpArrow 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 35.
   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(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)

Steps to reproduce

N/A

Expected behavior

N/A

Actual behavior

N/A

traumasv avatar Jul 05 '25 12:07 traumasv

This problem also occurred on my visual studio code, Here are the details:

哎呀,出现问题。请在报告此 Bug 时添加以下详细信息。
在 GitHub 上报告: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
上 183 个密钥:
 Space & Space ' e : \ H o l e \ v e n v \ S c r i p t s \ p y t h o n . e x e ' Space ' c : \ U s e r s \ A d m i n i s t r a t o r \ . v s c o d e \ e x t e n s i o n s \ m s - p y t h o n . d e b u g p y - 2 0 2 5 . 8 . 0 - w i n 3 2 - x 6 4 \ b u n d l e d \ l i b s \ d e b u g p y \ l a u n c h e r ' Space ' 3 1 4 5 ' Space ' - - ' Space ' E : \ H o l e \ s e t t i n g s . p y ' Space Enter


异常:
System.ArgumentOutOfRangeException: 该值必须大于或等于零,且必须小于控制台缓冲区在该维度的大小。
参数名: left
实际值是 -2。
   在 System.Console.SetCursorPosition(Int32 left, Int32 top)
   在 Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
   在 Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   在 Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   在 Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   在 Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   在 Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   在 Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   在 Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------
PS Version: 5.1.19041.2364
PS HostName: ConsoleHost
PSReadLine Version: 2.0.0-beta2
PSReadLine EditMode: Windows
OS: 10.0.19041.4522 (WinBuild.160101.0800)
BufferWidth: 128
BufferHeight: 29

inertialobs avatar Jul 07 '25 14:07 inertialobs

Hi @traumasv and @NonInertialObserver, thanks for opening the issue. Both of you are using very old version of PSReadLine (2.0.0 and 2.0.0-beta2). Please upgrade to the latest v2.3.6 version of PSReadLine. It contains fixes to similar issues. Feel free to report back if the issue still reproduces for you.

daxian-dbw avatar Jul 09 '25 21:07 daxian-dbw