[PR #2152] Added CopyOnSelect as a Global Setting #24839

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

Original Pull Request: https://github.com/microsoft/terminal/pull/2152

State: closed
Merged: Yes


Summary of the Pull Request

Introduces the "copyOnSelect" setting to "globals" as a boolean type. When set to true, a selection is immediately copied to your clipboard upon creation. When set to false, the selection persists and awaits further action.

PR Checklist

Detailed Description of the Pull Request / Additional comments

Standard "added a new global setting" changes
TermControl's PointerReleased event is updated to support a mouse button release event. Just hooked up the copy function right there.

Validation Steps Performed

  • copyOnSelect = true
    • make selection
    • right click to paste (selection persists)
    • Works! ✔
  • copyOnSelect = true
    • make selection
    • right click to paste
    • left click on a cell
    • right click to paste
    • same data should be pasted twice
    • Works! ✔
  • copyOnSelect = true
    • click on a cell (no selection)
    • drag to another cell (selection visible)
    • drag back to first cell (selection should persist, but should only cover one cell)
    • Works! ✔
  • copyOnSelect = false
    • make selection
    • selection persists
    • right click to copy (selection disappears)
    • right click to paste
    • Works! ✔
**Original Pull Request:** https://github.com/microsoft/terminal/pull/2152 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request Introduces the "copyOnSelect" setting to "globals" as a boolean type. When set to `true`, a selection is immediately copied to your clipboard upon creation. When set to `false`, the selection persists and awaits further action. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #524 * [x] CLA signed * [x] Tests ~added/passed~ not necessary * [x] Requires documentation to be updated * [x] I am a core contributor <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments Standard "added a new global setting" changes `TermControl`'s `PointerReleased` event is updated to support a mouse button release event. Just hooked up the copy function right there. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed - `copyOnSelect` = true - make selection - right click to paste (selection persists) - Works! ✔ - `copyOnSelect` = true - make selection - right click to paste - left click on a cell - right click to paste - same data should be pasted twice - Works! ✔ - `copyOnSelect` = true - click on a cell (no selection) - drag to another cell (selection visible) - drag back to first cell (selection should persist, but should only cover one cell) - Works! ✔ - `copyOnSelect` = false - make selection - selection persists - right click to copy (selection disappears) - right click to paste - Works! ✔
claunia added the pull-request label 2026-01-31 09:05:38 +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#24839