Duplicate copyOnSelect actions part 2 #6644

Closed
opened 2026-01-31 00:43:42 +00:00 by claunia · 5 comments
Owner

Originally created by @maguiresf on GitHub (Feb 28, 2020).

Originally assigned to: @leonMSFT on GitHub.

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.

  1. Open WSL Ubuntu terminal
  2. Split pane in two: pane_1 and pane_2
  3. Select a block on text with copyOnSelect enabled (for example "TEST1") on pane_1
  4. Ensure block of text remains highlighted
  5. Make pane_2 the active pane
  6. Switch to notepad instance
  7. Paste selected text into Notepad
  8. Make some change to text, (for example change string to "TEST999")
  9. Copy string inside Notepad
  10. Highlight Windows Terminal, clicking into the last active pane (pane_2)
  11. Paste string into Windows Terminal
  12. Now highlight the other pane (pane_1) that still has the original string highlighted
  13. 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

Originally created by @maguiresf on GitHub (Feb 28, 2020). Originally assigned to: @leonMSFT on GitHub. # 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. 1. Open WSL Ubuntu terminal 2. Split pane in two: pane_1 and pane_2 3. Select a block on text with copyOnSelect enabled (for example "TEST1") on pane_1 4. Ensure block of text remains highlighted 5. Make pane_2 the active pane 6. Switch to notepad instance 7. Paste selected text into Notepad 8. Make some change to text, (for example change string to "TEST999") 9. Copy string inside Notepad 10. Highlight Windows Terminal, clicking into the last active pane (pane_2) 11. Paste string into Windows Terminal 12. Now highlight the other pane (pane_1) that still has the original string highlighted 13. 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
Author
Owner

@zadjii-msft commented on GitHub (Feb 28, 2020):

Thanks for the great repro steps!

@zadjii-msft commented on GitHub (Feb 28, 2020): Thanks for the great repro steps!
Author
Owner

@leonMSFT commented on GitHub (Mar 4, 2020):

@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.

@leonMSFT commented on GitHub (Mar 4, 2020): @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.
Author
Owner

@DHowett-MSFT commented on GitHub (Mar 4, 2020):

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?

@DHowett-MSFT commented on GitHub (Mar 4, 2020): 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?
Author
Owner

@leonMSFT commented on GitHub (Mar 4, 2020):

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.

@leonMSFT commented on GitHub (Mar 4, 2020): 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.
Author
Owner

@maguiresf commented on GitHub (Mar 6, 2020):

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.

@maguiresf commented on GitHub (Mar 6, 2020): 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6644