PSReadLine error on code paste #19936

Open
opened 2026-01-31 06:57:59 +00:00 by claunia · 0 comments
Owner

Originally created by @wizardtoast on GitHub (May 24, 2023).

Windows Terminal version

1.16.10261.0

Windows build number

10.0.19045.0

Other Software

No response

Steps to reproduce

  1. Copy code snippet with multiple lines of code (code used)
  2. Ensure window height is small enough to require scrolling after pasting code
  3. Paste code snippet into terminal

Expected Behavior

Code is pasted without error and terminal ready for next input

Actual Behavior

Code is repeatedly cut off at various points, producing multiple variations of the same error, before finally working as expected.

One variation of error message produced:

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:
 t Space " A v e r a g e Space f i l e Space s i z e : Space $ a v e r a g e S i z e K B Space K B " Enter
 Space Space Space Space W r i t e - H o s t Space " A v e r a g e Space f i l e Space s i z e : Space $ a v e r a g e S i z e M B Space M B " Enter
 Space Space Space Space W r i t e - H o s t Space " L a r g e s t Space f i l e Space s i z e : Space $ l a r g e s t S i z e M B Space M B " Enter
 Space Space Space Space W r i t e - H o s t Space " L a r g e s t Space f i l e Space p a t h : Space $ l a r g e s t F i l e " 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 -8.
   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)

Other variations identical except different values for Actual value was X

Originally created by @wizardtoast on GitHub (May 24, 2023). ### Windows Terminal version 1.16.10261.0 ### Windows build number 10.0.19045.0 ### Other Software _No response_ ### Steps to reproduce 1. Copy code snippet with multiple lines of code ([code used](https://pastebin.com/fAyjy9h9)) 2. Ensure window height is small enough to require scrolling after pasting code 3. Paste code snippet into terminal ### Expected Behavior Code is pasted without error and terminal ready for next input ### Actual Behavior Code is repeatedly cut off at various points, producing multiple variations of the same error, before finally working as expected. One variation of error message produced: ``` 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: t Space " A v e r a g e Space f i l e Space s i z e : Space $ a v e r a g e S i z e K B Space K B " Enter Space Space Space Space W r i t e - H o s t Space " A v e r a g e Space f i l e Space s i z e : Space $ a v e r a g e S i z e M B Space M B " Enter Space Space Space Space W r i t e - H o s t Space " L a r g e s t Space f i l e Space s i z e : Space $ l a r g e s t S i z e M B Space M B " Enter Space Space Space Space W r i t e - H o s t Space " L a r g e s t Space f i l e Space p a t h : Space $ l a r g e s t F i l e " 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 -8. 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) ``` Other variations identical except different values for `Actual value was X`
claunia added the Needs-TriageIssue-BugNeeds-Attention labels 2026-01-31 06:58:00 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19936