Copy/Paste does not work, but Drag/Drop always works
Unable to copy and paste from the code editor window, but I can always drag/drop the text.
I do not have duplication steps, but it happens during every session.
<entry>
<record>1551</record>
<time>2019/11/14 19:13:36.518</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
 at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
 at PowerShellTools.Repl.ReplWindow.ClearInput()
 at PowerShellTools.Repl.ReplWindow.PreEditorCommandFilterExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 at PowerShellTools.Repl.ReplWindow.CommandFilter.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 at Microsoft.VisualStudio.Editor.Implementation.Undo.UndoManagerCommandFilter.Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 at Microsoft.VisualStudio.Editor.Implementation.IntellisenseCommandFilter.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 at Microsoft.VisualStudio.Editor.Implementation.BraceCompletionCommandFilter.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 at Microsoft.VisualStudio.Editor.Implementation.CommandHandlerServiceAdapter.<>c__DisplayClass17_0.<Exec>g__executeNextCommandTarget|1()
 at Microsoft.VisualStudio.Commanding.CommandHandlerExtensions.ExecuteCommand[T](ICommandHandler commandHandler, T args, Action nextCommandHandler, CommandExecutionContext executionContext)
 at Microsoft.VisualStudio.UI.Text.Commanding.Implementation.EditorCommandHandlerService.<>c__DisplayClass13_1`1.<Execute>b__1()
 at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call, Predicate`1 exceptionFilter)
--- End of stack trace from previous location where exception was thrown ---
 at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)</description>
</entry>
Same, but added new-lines
<entry>
<record>1551</record>
<time>2019/11/14 19:13:36.518</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)

at PowerShellTools.Repl.ReplWindow.ClearInput()

at PowerShellTools.Repl.ReplWindow.PreEditorCommandFilterExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at PowerShellTools.Repl.ReplWindow.CommandFilter.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.Undo.UndoManagerCommandFilter.Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.IntellisenseCommandFilter.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.BraceCompletionCommandFilter.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)

at Microsoft.VisualStudio.Editor.Implementation.CommandHandlerServiceAdapter.<>c__DisplayClass17_0.<Exec>g__executeNextCommandTarget|1()

at Microsoft.VisualStudio.Commanding.CommandHandlerExtensions.ExecuteCommand[T](ICommandHandler commandHandler, T args, Action nextCommandHandler, CommandExecutionContext executionContext)

at Microsoft.VisualStudio.UI.Text.Commanding.Implementation.EditorCommandHandlerService.<>c__DisplayClass13_1`1.<Execute>b__1()

at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call, Predicate`1 exceptionFilter)
--- End of stack trace from previous location where exception was thrown ---

at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)</description>
</entry>
Microsoft Visual Studio 2019 version: 16.0.29505.95
PoshTools 5.1.0
PSVersion 5.1.14409.1018
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1018
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Comments (8)
-
-
Account Deactivated reporter I believe so. It is hard to verify. When I look at clipboard history, it is always correct, but never pastes as the value shown.
I am not sure the log entry above is related, I provided just in case. Even if I do not get the error in VS activity log, the problem still happens. It has been happening for long time. I thought it would be resolved with the latest updates. Also, I though with $dte being null it would fail. However, I can still copy/paste properly when I open VS and $dte is not initialize.
When I created this, the interactive window was working as expected, the code window was failing.
-
Ok. Thanks. That’s helpful. I’ll look into it.
-
Account Deactivated reporter My problem now is that I can copy and paste outside of Visual Studio properly, but when I switch to Visual Studio and paste, the value is incorrect.
- The value “environment” is on the clipboard.
- I copy “status” from a file-difference-viewer and paste the value “status” into plain-text-editor as expected.
- I switch to VS with PowerShell project and paste, I get “environment” that was on the clipboard last, not expected.
- I switch back to plain-text-editor and paste, I get “enviornment” that was just pasted in VS, not expected.
- Using the clipboard viewer “Hot Copy Paste”.
- I copy anything, like this line.
- I switch to Visual Studio, a clipboard entry is created with “environment” without me doing anything.
-
I just reproduced this behavior. I haven’t pinned it down yet because I’m not seeing it happen every time. There is a keyboard filter for the Interactive Window that might be causing issues. The issue with the Interactive Window is that Ctrl+C means two different things when it comes to a terminal. Copy and Stop Execution. The keyboard filter shouldn’t be applying to the regular editor window but maybe there is something I’m missing.
I’ll let you know when I nail this down. Just to be clear, you’re not seeing the exception any more?
-
Account Deactivated reporter Correct. Not seeing the exception.
However, I think I know what the exception is from. I noticed this behavior, but have not had the opportunity to do it again, so the following is from memory.
I believe it is caused when you have multiple lines in the interactive window, the prompt does not display, you place the cursor into one of those lines, then press Esc.
-
Account Deactivated reporter Here is something very interesting.
- The interactive window has a blank line above the prompt.
- I cannot copy the path of a file. I tried via the tab and via the solution explorer.
- I open “Hot Copy Paste” and there is no new entry
- I thought that maybe clearing the interactive window would help
- I clicked the ‘Clear Screen’ glyph.
- I was then able to copy the path through the solution explorer.
- Switch from VS to other apps and back to VS did not change the clipboard
-
Account Deactivated reporter Verified / Duplicated Exception
I believe it is caused when you have multiple lines in the interactive window, the prompt does not display, you place the cursor into one of those lines, then press Esc.<<
- Interactive Window contains multiple lines, but the prompt does not display.
- Place the cursor in one of those lines.
- Press Esc
- Log in to comment
I just want to make sure. This is happening in the code editor and not the PowerShell Interactive Window?