Skip to content

Exception on Linux when pasting with CTRL+SHIFT+V #4682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
Q-DavidStein opened this issue Mar 27, 2025 · 1 comment
Open
3 tasks done

Exception on Linux when pasting with CTRL+SHIFT+V #4682

Q-DavidStein opened this issue Mar 27, 2025 · 1 comment
Labels
Area-Stability Label for tracking stability Issues Needs-Triage 🔍 It's a new issue that core contributor team needs to triage.

Comments

@Q-DavidStein
Copy link

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

Oops, something went wrong.                                                                                                                                                                                      
Please report this bug with ALL the details below, including both the 'Environment' and 'Exception' sections.                                                                                                    
Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.yaml                                                                                                            
Thank you!                                                                                                                                                                                                       
                                                                                                                                                                                                                 
### Environment                                                                                                                                                                                                  
PSReadLine: 2.3.6+d2e770f93b7a53d8660a6402eb29d1ae1c35e767
PowerShell: 7.5.0
OS: Linux Mint 22.1
BufferWidth: 209
BufferHeight: 29

Last 200 Keys:

 l Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace 3 5 1 . x m l Enter
 UpArrow Spacebar - Tab Tab l o Tab Spacebar Tab c o m Tab Enter
 UpArrow Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Tab Tab b a d Tab Enter
 UpArrow Spacebar - Tab Tab J S Tab Backspace Backspace Backspace Backspace e x Tab Enter
 UpArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow RightArrow 9 Delete RightArrow RightArrow RightArrow RightArrow RightArrow Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Spacebar Enter
 c a p l i s t Enter
 r e s t a r t - r e q u e s t Spacebar 7 f 1 5 6 a a e - 8 4 a f - 4 1 0 0 - 8 9 9 d - 5 f e a 1 0 f 5 9 b c 7

### Exception

System.InvalidOperationException: Cannot locate the offset in the rendered text that was pointed by the original cursor. Initial Coord: (38, 31) Buffer: (209, 32) Cursor: (85, 28)
   at Microsoft.PowerShell.PSConsoleReadLine.RecomputeInitialCoords(Boolean isTextBufferUnchanged)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(PSKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken, Nullable`1 lastRunStatus)

Screenshot

Image

Environment data

PS Version: 7.5.0
PS HostName: ConsoleHost
PSReadLine Version: 2.3.6
PSReadLine EditMode: Emacs
OS: Linux p50 6.8.0-56-generic #58-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 14 15:33:28 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
BufferWidth: 209
BufferHeight: 32

Steps to reproduce

Run a local module function and paste in a value using CTRL+SHIFT+V for the input parameter. It's never done this before.

Expected behavior

No exceptions/errors.

Actual behavior

Displayed the error shown above.

@settdigger
Copy link

I got a similar crash today: 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 -2.
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)

@daxian-dbw daxian-dbw changed the title PSReadLine Error / Bug Report Exception on Linux when pasting with CTRL+SHIFT+V May 22, 2025
@daxian-dbw daxian-dbw added the Area-Stability Label for tracking stability Issues label May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Stability Label for tracking stability Issues Needs-Triage 🔍 It's a new issue that core contributor team needs to triage.
Projects
None yet
Development

No branches or pull requests

4 participants
@daxian-dbw @settdigger @Q-DavidStein and others