Pasting more than 200 characters into a PowerShell 5x session within Windows Terminal Version: 1.0.1811.0 causes an exception
See original GitHub issueThe following statement will throw an exception in PowerShell terminal. This will not throw in the Windows PowerShell on V5 or V7.
catch { if ($error.CategoryInfo.reason -eq ‘PSRemotingTransportException’) { $exception = [exception]::new(“You must enter credentials for the remote machine.”) $errorRecord = [System.Management.Automation.ErrorRecord]::new($exception, “Not Connected”, “InvalidOperation”, $null) $PSCmdlet.ThrowTerminatingError($errorRecord) }
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: r e m o t e Space m a c h i n e . " ) Tab Tab Enter Tab Tab Tab $ e r r o r R e c o r d Space = Space [ S y s t e m . M a n a g e m e n t . A u t o m a t i o n . E r r o r R e c o r d ] : : n e w ( $ e x c e p t i o n , Space " N o t Space C o n n e c t e d " , Space " I n v a l i d O p e r a t i o n " , Space $ n u l l ) Enter Tab Tab Tab $ P S C m d l e t . T h r o w T e r m i n a t i n g E r r o r ( $ e r r o r R e c o r d ) Enter Tab Tab } Enter Tab } 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 -22.
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(Nullable1 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)
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
This issue was fixed (see #1306). Please upgrade to the 2.0.2 version of PSReadLine from PowerShellGallery. See the upgrading section for instructions. Please let us know if you run into the same issue with the latest version.
That did the trick. It said I was running the rerelease in the psd1 and I just did an install-module so I can update it. Problem is gone. I guess we can close out the issue 😊
Thanks Dave
From: vexx32 notifications@github.com Sent: Sunday, July 19, 2020 6:48 PM To: PowerShell/PSReadLine PSReadLine@noreply.github.com Cc: Dave dgoldman@dgoldman.org; Author author@noreply.github.com Subject: Re: [PowerShell/PSReadLine] Pasting more than 200 characters into a PowerShell 5x session within Windows Terminal Version: 1.0.1811.0 causes an exception (#1675)
Before we go too much further, I’d recommend updating to at least v2.0.2 of PSReadLine; I know there were a bunch of issues related to buffer handling that were fixed in 2.0.0 GA and subsequent patches. I’m not sure if you’re using GA or the pre-release version there, but either way best first step is to see if it’s still happening on the latest release 🙂
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/PowerShell/PSReadLine/issues/1675#issuecomment-660720916, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJQPRPGLQX2YJWVBAIEW6RTR4NZYVANCNFSM4PBLQJYA.