question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pasting more than 200 characters into a PowerShell 5x session within Windows Terminal Version: 1.0.1811.0 causes an exception

See original GitHub issue

The 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, Dictionary2 dispatchTable, Boolean ignoreIfNoAction, Object arg) at Microsoft.PowerShell.PSConsoleReadLine.InputLoop() at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
daxian-dbwcommented, Jul 22, 2020

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.

1reaction
dgoldman-msftcommented, Jul 19, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pasting into PowerShell running in Windows Terminal ...
If PowerShell runs within Windows Terminal, the paste action drops the U+2019 character, resulting in an error: PS> gci "C:\tmp\Captures décran" ...
Read more >
How do I get Windows Terminal to stop asking me every ...
When this is set to true, trying to paste text with multiple lines will display a dialog asking you whether to continue or...
Read more >
Windows Terminal Interaction Settings
Learn how to customize interaction settings within Windows Terminal.
Read more >
Copied-and-pasted tab characters not recognized by ...
Copying and pasting ` a` is a MWE as the tab character will not be present in the command line. I would be...
Read more >
Windows 10 built-in SSH Client. How to paste the password?
You can try to past your password using Ctrl + V (it should work as expected). You can also paste into the PowerShell...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found