PowerShell / PSReadLine

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

Strange bug with double quotes #4049

Closed CharlesRobertoSky closed 1 month ago

CharlesRobertoSky commented 1 month ago

Prerequisites

Exception report

Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------   
Last 107 Keys:
 Ctrl+c Ctrl+c c d Space Ctrl+w Backspace Backspace Backspace Backspace Backspace c d Space w e b s i t e Enter
 n p m Space r u n Space b u i l d Enter
 c d Space . . Enter
 g i t Space c o m m i t Space - m Space " Ctrl+c Ctrl+v Ctrl+v UpArrow BaSpace p u s h Space o i Backspace r i g i n Space m a i n Enter
 " Backspace Backspace " Shift+Tab "

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: left
Actual value was -1.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(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.PSCon

Screenshot

imagem_2024-06-22_235854189

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.19041.4412
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.4412
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Platform ServicePack Version      VersionString
-------- ----------- -------      -------------
 Win32NT             10.0.19045.0 Microsoft Windows NT 10.0.19045.0

Steps to reproduce

When I went to make a commit, when I wrote the double quotes this error appeared

Expected behavior

make a commit

Actual behavior

return error

github-actions[bot] commented 1 month ago

This issue was already fixed (see #1306). Please upgrade to the 2.3.5 version of PSReadLine from PowerShell Gallery. See the upgrading section for instructions. Please let us know if you run into the same issue with the latest version.