[PR #4819] [MERGED] Ignore right-click copy when copy on select is enabled #25965

Open
opened 2026-01-31 09:12:57 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4819
Author: @leonMSFT
Created: 3/6/2020
Status: Merged
Merged: 3/10/2020
Merged by: @undefined

Base: masterHead: dev/lelian/cos


📝 Commits (4)

  • 611b0bb Fix right click copy on select on pointer release
  • ad34d91 a better way of checking for pointer release type
  • 9d7e99a adding more comments
  • 58bb3a5 comments and clarifications

📊 Changes

2 files changed (+37 additions, -42 deletions)

View changed files

📝 src/cascadia/TerminalControl/TermControl.cpp (+33 -39)
📝 src/cascadia/TerminalControl/TermControl.h (+4 -3)

📄 Description

Summary of the Pull Request

Right clicking on a focused tab while Copy On Select is active currently copies any active selection. This is because PointerReleasedHandler doesn't check for the mouse button that was released.
During a mouse button release, only the left mouse button release should be doing anything.

PR Checklist

Validation Steps Performed

These are the scenarios I've tested. They're a combination of in focus/out of focus, Copy On Select on/off, left/right click pressed and their move and release variants.

From Out of Focus:

  • Left Click = Focus
  • Left Click Move = Focus + Selection
  • Left Click Release
    • CoS on = Copy
    • CoS off = Nothing
  • Shift Left Click = Focus
  • Right Click
    • Focus
    • CoS on = Paste
    • CoS off = Copy if Active Selection, Paste if not.
  • Right Click Move = Nothing
  • Right Click Release = Nothing

From In Focus

  • Left Click = Selection if CoS off
  • Left Click Move = Selection
  • Left Click Release
    • CoS on = Copy
    • CoS off = Nothing
  • Shift Left Click = Set Selection Anchor
  • Right Click
    • CoS on = Paste
    • CoS off = Copy if Active Selection, Paste if not.
  • Right Click Move = Nothing
  • Right Click Release = Nothing

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/4819 **Author:** [@leonMSFT](https://github.com/leonMSFT) **Created:** 3/6/2020 **Status:** ✅ Merged **Merged:** 3/10/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/lelian/cos` --- ### 📝 Commits (4) - [`611b0bb`](https://github.com/microsoft/terminal/commit/611b0bb63395d62952b341648690eb2036c9e4a5) Fix right click copy on select on pointer release - [`ad34d91`](https://github.com/microsoft/terminal/commit/ad34d912686951a29bf713d5e53ed6a70b6ce393) a better way of checking for pointer release type - [`9d7e99a`](https://github.com/microsoft/terminal/commit/9d7e99ab146351b74373434bf8ddab1da5c1c5bd) adding more comments - [`58bb3a5`](https://github.com/microsoft/terminal/commit/58bb3a5c6a7e3abdbf37ea888a01bb7de6ea225e) comments and clarifications ### 📊 Changes **2 files changed** (+37 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+33 -39) 📝 `src/cascadia/TerminalControl/TermControl.h` (+4 -3) </details> ### 📄 Description <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Right clicking on a focused tab while Copy On Select is active currently copies any active selection. This is because `PointerReleasedHandler` doesn't check for the mouse button that was released. During a mouse button release, only the left mouse button release should be doing anything. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #4740 * [x] CLA signed. * [x] Tests added/passed <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed These are the scenarios I've tested. They're a combination of in focus/out of focus, Copy On Select on/off, left/right click pressed and their move and release variants. From Out of Focus: - Left Click = Focus - Left Click Move = Focus + Selection - Left Click Release - CoS on = Copy - CoS off = Nothing - Shift Left Click = Focus - Right Click - Focus - CoS on = Paste - CoS off = Copy if Active Selection, Paste if not. - Right Click Move = Nothing - Right Click Release = Nothing From In Focus - Left Click = Selection if CoS off - Left Click Move = Selection - Left Click Release - CoS on = Copy - CoS off = Nothing - Shift Left Click = Set Selection Anchor - Right Click - CoS on = Paste - CoS off = Copy if Active Selection, Paste if not. - Right Click Move = Nothing - Right Click Release = Nothing --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:12:57 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#25965