Clicking (not dragging) inside the terminal window shouldn't flush the clipboard #9587

Closed
opened 2026-01-31 01:58:27 +00:00 by claunia · 3 comments
Owner

Originally created by @berzi on GitHub (Jul 12, 2020).

Environment

Windows build number: Microsoft Windows [Version 10.0.19041.329]
Windows Terminal version (if applicable): 1.0.1811.0

Steps to reproduce

Copy anything to the clipboard, then click in the terminal window, anywhere but the title bar.

Expected behavior

Dragging text in the terminal replaces the clipboard's contents with it.
Clicking without selecting any text does not impact the clipboard.

Actual behavior

Dragging text does behave as expected, however when simply clicking, without selecting anything, the clipboard is flushed completely, which also affects data copied from outside Windows Terminal and may result in unexpected data loss as a result of interacting with it.

Originally created by @berzi on GitHub (Jul 12, 2020). # Environment ```none Windows build number: Microsoft Windows [Version 10.0.19041.329] Windows Terminal version (if applicable): 1.0.1811.0 ``` # Steps to reproduce Copy anything to the clipboard, then click in the terminal window, anywhere but the title bar. # Expected behavior Dragging text in the terminal replaces the clipboard's contents with it. Clicking without selecting any text does not impact the clipboard. # Actual behavior Dragging text does behave as expected, however when simply clicking, without selecting anything, the clipboard is flushed completely, which also affects data copied from outside Windows Terminal and may result in unexpected data loss as a result of interacting with it.
Author
Owner

@zadjii-msft commented on GitHub (Jul 16, 2020):

I'm presuming you have copyOnSelect enabled, right?

@zadjii-msft commented on GitHub (Jul 16, 2020): I'm presuming you have `copyOnSelect` enabled, right?
Author
Owner

@DHowett commented on GitHub (Jul 16, 2020):

For what it's worth, I exclusively use copyOnSelect and I cannot reproduce this. This is supposed to explicitly guard against it:

09471c3753/src/cascadia/TerminalControl/TermControl.cpp (L1109-L1114)

@DHowett commented on GitHub (Jul 16, 2020): For what it's worth, I exclusively use `copyOnSelect` and I cannot reproduce this. This is supposed to explicitly guard against it: https://github.com/microsoft/terminal/blob/09471c3753d888abcfd160dae524988003da862a/src/cascadia/TerminalControl/TermControl.cpp#L1109-L1114
Author
Owner

@berzi commented on GitHub (Jul 16, 2020):

It doesn't seem to happen anymore, regardless of the copyOnSelect setting. I assume the behaviour was linked to some specific other application I tried it with. I will update with more information if it happens again (and if the problem seems tied to WT and not this other application).

@berzi commented on GitHub (Jul 16, 2020): It doesn't seem to happen anymore, regardless of the copyOnSelect setting. I assume the behaviour was linked to some specific other application I tried it with. I will update with more information if it happens again (and if the problem seems tied to WT and not this other application).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9587