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.

Ctrl+a Ctrl+c throws an exception

See original GitHub issue

I was just trying to figure out the new editing functionality in Win10 pressing Ctrl+anything, and got an exception. After a little more prodding around, it looks like this is almost always triggered by typing a few characters and then pressing Ctrl+a Ctrl+c.

I was given this message:

Last 200 Keys:
 Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace a s d f a s d f Ctrl+r j k l ; Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Enter
 a s d k f j a s l d k f j l s k d j f Ctrl+i Backspace Ctrl+r Backspace Ctrl+r Ctrl+R Backspace Ctrl+R Backspace Ctrl+e Backspace Ctrl+w Backspace Ctrl+q Backspace Ctrl+a Ctrl+s Enter
 Ctrl+s Enter
 Ctrl+w Backspace Ctrl+e Ctrl+e Backspace Backspace Ctrl+r Backspace Enter
 Ctrl+r Enter
 Ctrl+t Backspace Ctrl+y Ctrl+u Backspace Ctrl+y Ctrl+y Ctrl+y Ctrl+h Ctrl+y Ctrl+Backspace Ctrl+h Ctrl+h Ctrl+h Ctrl+f Ctrl+f Ctrl+Backspace Ctrl+h Ctrl+h Ctrl+h Ctrl+t Ctrl+y Ctrl+y Ctrl+y Ctrl+y Ctrl+j Ctrl+i Ctrl+o Ctrl+p Ctrl+[ Ctrl+] Ctrl+\ Ctrl+' Ctrl+; Ctrl+\ Ctrl+Backspace Ctrl+- Ctrl+= Enter
 Ctrl+/ Ctrl+. Ctrl+, Ctrl+l Ctrl+; Ctrl+l Ctrl+k Ctrl+j Ctrl+h Ctrl+g Ctrl+f Ctrl+d Ctrl+s Ctrl+a Ctrl+z Ctrl+x Ctrl+c Ctrl+v Ctrl+b Ctrl+n Ctrl+m Ctrl+, Ctrl+. Ctrl+z Ctrl+x Ctrl+z Ctrl+z a s d f Ctrl+r Ctrl+c j k l Ctrl+z o LeftArrow Ctrl+z LeftArrow Ctrl+z Ctrl+z d a n g Ctrl+m Ctrl+n Ctrl+b Ctrl+v Ctrl+c Ctrl+v Ctrl+v Ctrl+c Ctrl+x j k l j k Ctrl+a Ctrl+c

Exception:
System.Runtime.InteropServices.ExternalException (0x800401D0): Requested Clipboard operation did not succeed.
   at System.Windows.Forms.Clipboard.ThrowIfFailed(Int32 hr)
   at System.Windows.Forms.Clipboard.SetDataObject(Object data, Boolean copy, Int32 retryTimes, Int32 retryDelay)
   at System.Windows.Forms.Clipboard.SetText(String text, TextDataFormat format)
   at Microsoft.PowerShell.PSConsoleReadLine.Copy(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.CopyOrCancelLine(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)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
lzybkrcommented, Sep 14, 2017

I believe I’ve fixed this now using retries like @rkeithhill suggested, see https://github.com/lzybkr/PSReadLine/blob/fb10c6d9c3bb413aafdfe8073004b59d4a294535/PSReadLine/Clipboard.cs#L237. The fix is sitting in the ansi_render branch until I think it’s ready for release. You can build it yourself or grab a build out of appveyor.

0reactions
FarfanColincommented, Oct 28, 2020

I got this error, any guess!! Tks in advance

Oops, something went wrong. Please report this bug with the details below. Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new

Last 105 Keys: g i t Space s t a t s Backspace u s Enter g i t Backspace Backspace Backspace Backspace g i t Space r e m o t e Space - v Enter g i t Space a d d Space . Enter g i t Space c o m m i t Space - m Space " Ctrl+c Ctrl+c UpArrow DownArrow g i t Space c o m m i t Space - m Space Ctrl+v Ctrl+c Ctrl+c UpArrow Backspace Backspace Backspace Backspace Backspace c o m m i t Space - m Space 2 Backspace d s Backspace Backspace 3 Backspace "

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(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)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Catching Ctrl+C signal throws exception "Job manager has ...
One of the common issues with a shutdown hook is that there is no guaranteed order of shuting down things.
Read more >
Can ctrl-c throw an exception?
Can I set things up so that if I hit ctrl-c while a program is running, then a catch block will be run...
Read more >
capturing ctrl-C exception - Oracle Forums
Hello - I'm new to Java so maybe this is a basic question: how can I capture ctrl-C in my program? I used...
Read more >
Complete Guide to Python KeyboardInterrupt
In Python, the interpreter throws a KeyboardInterrupt exception when the user/programmer presses the ctrl – c or del key either accidentally ...
Read more >
How do I catch a Ctrl+C event in C++?
The CTRL + C is one signal in C or C++. So we can catch by signal catching technique. For this signal, the...
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