Duplicate copyOnSelect actions part 2
Environment
Platform ServicePack Version VersionString
Win32NT 10.0.18363.0 Microsoft Windows NT 10.0.18363.0
Windows Terminal Version 0.9.433.0
Steps to reproduce
Please note, this isn't a duplicate of issue #4255 which I reported previously, it's a variation of the same issue which is still present in the latest version where as 4255 is now fixed.
- Open WSL Ubuntu terminal
- Split pane in two: pane_1 and pane_2
- Select a block on text with copyOnSelect enabled (for example "TEST1") on pane_1
- Ensure block of text remains highlighted
- Make pane_2 the active pane
- Switch to notepad instance
- Paste selected text into Notepad
- Make some change to text, (for example change string to "TEST999")
- Copy string inside Notepad
- Highlight Windows Terminal, clicking into the last active pane (pane_2)
- Paste string into Windows Terminal
- Now highlight the other pane (pane_1) that still has the original string highlighted
- Paste again
Expected behavior
In both steps 11 and 13, the last copied string, "TEST999", is pasted
Actual behavior
In step 11, TEST999 is pasted In step 13, TEST1 is pasted
Thanks for the great repro steps!
@maguiresf Just to see if I'm understanding the steps correctly, in Step 12, you're simply refocusing pane_1 by single clicking on it right? In addition, throughout all the steps, TEST1 is still highlighted on pane_1?
If what I described is correct, the behavior we've coded for is to only copy to clipboard the first time a selection is made, and so since "TEST1" was selected for the first time on Step 3, that's the only time "TEST1" will be copied to the clipboard. Refocusing on a pane with a selection active should not trigger a copy on select on that selection. This is the behavior that was expected in #4255. So, in step 12, refocusing pane_1 will not recopy "TEST1" to the clipboard, which is why "TEST999" (which was copied from notepad) is pasted.
Nah, this does repro for me. The right-click paste in pane 2 causes a copy of pane 2's selection.
Should we just suppress right-click copy in CoS cases?
Argh you're right, it's the right click that repros, I think it's reasonable to suppress right-click copy in this case then.
Ah, apologies, I should have mentioned I was using right-click to paste.
I'd just found another variation of this involving switching between tabs and panes but it again only appears to be triggered when using right-click to paste so it looks like it must be the same issue.