PowerShell / PSReadLine

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

System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size #782

Closed iain-clements closed 5 years ago

iain-clements commented 6 years ago

Environment data

PS version: 6.1.0 PSReadline version: 2.0.0-beta3 os: Linux cc-d9773597-b65688c4b-7j6mz 4.15.0-1025-azure #26~16.04.1-Ubuntu SMP Tue Sep 25 11:09:50 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux PS file version:

Steps to reproduce or 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 200 Keys:

 e m b e r R e s p o n s e Space = Space I n v o k e - R e s t M e t h o d Space - U r i Space $ i n s e r t T e a m M e m b e r U r l Space- H e a d e r s Space $ h e a d e r s W C o n t e n t T y p e Space - B o d y Space $ i n s e r t O b j e c t J s o n Space - M e t h o d Space P o s t Enter
 Space Space Space Space Enter
 Space Space Space Space } Space e l s e Space { Enter
 Space Space Space Space Space Space Space Space " T h e Space u s e r Space $ a z u r e E m a i l Space a l r e a d y Space e x i s t e d "Enter
 Space Space Space Space } Enter
 Enter
 }

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 -14.
   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.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.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
lzybkr commented 6 years ago

Did you have more lines in your command than the buffer can display? If so, this is probably the same issues as #663.

iain-clements commented 6 years ago

Thanks Jason, I think you are right I was not pressing return to make extra lines in the console - just pasting in the whole file on line one. Could my bug report be merged in with this branch please?

Thanks

Iain

On Mon, 22 Oct 2018 at 16:18, Jason Shirk notifications@github.com wrote:

Did you have more lines in your command than the buffer can display? If so, this is probably the same issues as #663 https://github.com/lzybkr/PSReadLine/issues/663.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lzybkr/PSReadLine/issues/782#issuecomment-431865862, or mute the thread https://github.com/notifications/unsubscribe-auth/ApEn9NUsVgp_doSNr3sDxedCJhuSfKNWks5uneHUgaJpZM4XzU3v .

-- Iain Clements Director

Email: iain@cloudursa.com Mobile: +44 7734389366 http://www.cloudursa.com

[image: --]

itpcc commented 5 years ago

I also have the same issue too:

PS ${PWD}>
Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 2 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)
-----------------------------------------------------------------------
larryw3i commented 5 years ago

I also have the same issue too:

Last 2 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.Internal.VirtualTerminal.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.PlaceCursor(Int32 x, Int32 y)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Render()
   at Microsoft.PowerShell.PSConsoleReadLine.UpdateFromHistory(HistoryMoveCursor moveCursor)
   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, CancellationToken cancellationToken)

daxian-dbw commented 5 years ago

Close as a duplicate of #663