Skip to content
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

Blank lines and error messages occur when pasting with right click of mouse #3693

Closed
steveharsant opened this issue Nov 25, 2019 · 3 comments
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@steveharsant
Copy link

Environment

Platform ServicePack Version      VersionString
-------- ----------- -------      -------------
 Win32NT             10.0.18362.0 Microsoft Windows NT 10.0.18362.0

Windows Terminal (Preview)
Version: 0.6.2951.0

$PSVersionTable.PSVersion
Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      18362  145

Steps to reproduce

  • Open Windows terminal with a Powershell tab
  • Copy a function containing an if statement
  • Paste the copied code with mouse right click (ctrl+v does not produce this behaviour)

Expected behavior

Copied function should be pasted with the same behaviour as ctrl+v.
i.e. Pasted code should not be interpreted until the enter key is pressed, with the same formatting as the source it was copied from.

Actual behavior

  • When pasting with right-click of the mouse, extra blank lines are generated between code and at the end of the copied text.
  • An error message is populate once per if statement. The error message reads:
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:
 p a c e s Enter
 Ctrl+Enter Space Space Space Space Space Space Space Space $ m e s s a g e Space = Space @ { Enter
 Ctrl+Enter Space Space Space Space Space Space Space Space Space Space Space Space t i t l e Space = Space $ t i t l e ; Enter
 Ctrl+Enter Space Space Space Space Space Space Space Space Space Space Space Space t e x t Space = Space $ b o d y T e x t . R e p l a c e ( " ` n " , Space " Space Space ` n " ) Enter
 Ctrl+Enter Space Space Space Space Space Space Space Space } Enter
 Ctrl+Enter Space Space Space Space Space Space Space Space i f ( T e s t - P a t h Space - p a t h Space C : \ ) Enter
 Ctrl+Enter Space Space Space Space Space Space Space Space { Enter
 Ctrl+Enter Space Space Space Space Space Space Space Space Space Space Space Space Enter
 Ctrl+Enter Space Space Space Space Space Space Space Space } Enter
 Ctrl+Enter Enter
 Ctrl+Enter Enter
 Ctrl+Enter Enter
 Ctrl+Enter Enter
 Ctrl+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 -2.
   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.AcceptLineImpl(Boolean validate)
   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)
-----------------------------------------------------------------------

Aditional Information

  • Although when using ctrl+v to paste, the error messages do not occur, extra blank lines are still generated.
  • This behaviour (both the error messages and blank lines) do not occur with vanialla Powershell
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Nov 25, 2019
@DHowett-MSFT
Copy link
Contributor

This is a /dupe of #1091, which will be fixed in the next release.

@ghost
Copy link

ghost commented Nov 25, 2019

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed Nov 25, 2019
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Nov 25, 2019
@steveharsant
Copy link
Author

This is a /dupe of #1091, which will be fixed in the next release.

@DHowett-MSFT thank you, and apologies for the dupe, I couldn't find it when searching for one

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

2 participants