[PR #1093] Connect clipboard functionality to their keybindings #24485

Closed
opened 2026-01-31 09:03:34 +00:00 by claunia · 0 comments
Owner

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

State: closed
Merged: Yes


Summary of the Pull Request

Connects copy and paste keybindings to the appropriate clipboard functionality within Terminal.

References

#1072, #968

PR Checklist

  • Closes Forms of communication between developers?(Discord/Teams/Slack/Email) (#968)
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be updated
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #1072, #968 his connects the (mostly) pre-existing copy/paste mechanics to the keyboard shortcut mechanics.

Detailed Description of the Pull Request / Additional comments

Changes:

  • Added TermControl::PasteTextFromClipboard which does what it says on the tin. Refactored the paste code from the right-click handling in TermControl here.
  • Added App::_PasteText, mirroring the pre-existing App::_CopyText
  • Added connections from keybindings to copy/paste functionality in App::_HookupKeyBindings

Notes:

  • This PR interprets the keybinding "copy" as a copy trimming trailing whitespace (the operation performed by a right-click with a selection active). It may be appropriate to add a keybinding for a whitespace-preserving copy (which is now done as a shift-right-click with a selection active).
**Original Pull Request:** https://github.com/microsoft/terminal/pull/1093 **State:** closed **Merged:** Yes --- <!-- 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 Connects copy and paste keybindings to the appropriate clipboard functionality within Terminal. <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References #1072, #968 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #968 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Requires documentation to be updated * [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #1072, #968 his connects the (mostly) pre-existing copy/paste mechanics to the keyboard shortcut mechanics. <!-- 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 Changes: - Added TermControl::PasteTextFromClipboard which does what it says on the tin. Refactored the paste code from the right-click handling in TermControl here. - Added App::_PasteText, mirroring the pre-existing App::_CopyText - Added connections from keybindings to copy/paste functionality in App::_HookupKeyBindings Notes: - This PR interprets the keybinding "copy" as a copy trimming trailing whitespace (the operation performed by a right-click with a selection active). It may be appropriate to add a keybinding for a whitespace-preserving copy (which is now done as a shift-right-click with a selection active).
claunia added the pull-request label 2026-01-31 09:03:34 +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#24485