[PR #2446] [MERGED] Don't copy if there's no selection #24933

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/2446
Author: @zadjii-msft
Created: 8/15/2019
Status: Merged
Merged: 8/16/2019
Merged by: @DHowett-MSFT

Base: masterHead: dev/migrie/2285-typed-kb-events


📝 Commits (10+)

  • abe44da Uhg this should work but it doesn't compile :(
  • 5eea316 Welp I'm dumb
  • 17937d2 Convert just NewTabWithProfile to an args + EventArgs structure
  • fa5f4cb Convert copy to be args + eventArgs
  • 6b4d1e2 What the damn hell is going on
  • 8cddf1a Hey I fixed it!
  • 4906884 Clean this up
  • 508c563 Make ActionArgs a property of ActionEventArgs
  • 87ffad3 Only attempt to copy text if a selection is active
  • abc7a34 Apply feedback from PR

📊 Changes

14 files changed (+773 additions, -237 deletions)

View changed files

src/cascadia/TerminalApp/ActionArgs.cpp (+13 -0)
src/cascadia/TerminalApp/ActionArgs.h (+69 -0)
src/cascadia/TerminalApp/ActionArgs.idl (+54 -0)
📝 src/cascadia/TerminalApp/App.cpp (+32 -24)
📝 src/cascadia/TerminalApp/App.h (+26 -2)
src/cascadia/TerminalApp/AppActionHandlers.cpp (+183 -0)
📝 src/cascadia/TerminalApp/AppKeyBindings.cpp (+281 -119)
📝 src/cascadia/TerminalApp/AppKeyBindings.h (+25 -24)
📝 src/cascadia/TerminalApp/AppKeyBindings.idl (+25 -57)
📝 src/cascadia/TerminalApp/lib/TerminalAppLib.vcxproj (+13 -1)
📝 src/cascadia/TerminalControl/TermControl.cpp (+11 -6)
📝 src/cascadia/TerminalControl/TermControl.h (+2 -1)
📝 src/cascadia/TerminalControl/TermControl.idl (+3 -3)
📝 src/cascadia/inc/cppwinrt_utils.h (+36 -0)

📄 Description

Summary of the Pull Request

Converts every action we have to a TypedEventHandler. These are in accordance with #1349. This allows us to not handle some events, like the Copy event.

References

Really heavily inspired by #1349. @DHowett-MSFT thinks we should ship this fix this month an I agree. Hence the PR before the spec is finished.

PR Checklist

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed


🔄 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/2446 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 8/15/2019 **Status:** ✅ Merged **Merged:** 8/16/2019 **Merged by:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Base:** `master` ← **Head:** `dev/migrie/2285-typed-kb-events` --- ### 📝 Commits (10+) - [`abe44da`](https://github.com/microsoft/terminal/commit/abe44dacb998a043051e6fa77d659344f8d51972) Uhg this should work but it doesn't compile :( - [`5eea316`](https://github.com/microsoft/terminal/commit/5eea316bc66b528052183316fca86717942ce7ec) Welp I'm dumb - [`17937d2`](https://github.com/microsoft/terminal/commit/17937d24d8a1cffa9610afb5a79b1482f4675bc4) Convert _just_ NewTabWithProfile to an args + EventArgs structure - [`fa5f4cb`](https://github.com/microsoft/terminal/commit/fa5f4cb91faf4586161addf84dacbb517d7b887a) Convert copy to be args + eventArgs - [`6b4d1e2`](https://github.com/microsoft/terminal/commit/6b4d1e2ef8a302474daf9f0e87c94135ae31280a) What the damn hell is going on - [`8cddf1a`](https://github.com/microsoft/terminal/commit/8cddf1aa74c6e3f11dff19d616c6a9265b0d0d98) Hey I fixed it! - [`4906884`](https://github.com/microsoft/terminal/commit/49068845548573ba4cc1cfd89df8f8f31057b659) Clean this up - [`508c563`](https://github.com/microsoft/terminal/commit/508c56393cf5977ac946362db116077a6faa72bc) Make ActionArgs a property of ActionEventArgs - [`87ffad3`](https://github.com/microsoft/terminal/commit/87ffad33770e226fa09b70e05dc328803c98edb2) Only attempt to copy text if a selection is active - [`abc7a34`](https://github.com/microsoft/terminal/commit/abc7a34a1e547ffe2bb3276c6cf6c04d73b2fba5) Apply feedback from PR ### 📊 Changes **14 files changed** (+773 additions, -237 deletions) <details> <summary>View changed files</summary> ➕ `src/cascadia/TerminalApp/ActionArgs.cpp` (+13 -0) ➕ `src/cascadia/TerminalApp/ActionArgs.h` (+69 -0) ➕ `src/cascadia/TerminalApp/ActionArgs.idl` (+54 -0) 📝 `src/cascadia/TerminalApp/App.cpp` (+32 -24) 📝 `src/cascadia/TerminalApp/App.h` (+26 -2) ➕ `src/cascadia/TerminalApp/AppActionHandlers.cpp` (+183 -0) 📝 `src/cascadia/TerminalApp/AppKeyBindings.cpp` (+281 -119) 📝 `src/cascadia/TerminalApp/AppKeyBindings.h` (+25 -24) 📝 `src/cascadia/TerminalApp/AppKeyBindings.idl` (+25 -57) 📝 `src/cascadia/TerminalApp/lib/TerminalAppLib.vcxproj` (+13 -1) 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+11 -6) 📝 `src/cascadia/TerminalControl/TermControl.h` (+2 -1) 📝 `src/cascadia/TerminalControl/TermControl.idl` (+3 -3) 📝 `src/cascadia/inc/cppwinrt_utils.h` (+36 -0) </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 Converts every action we have to a TypedEventHandler. These are in accordance with #1349. This allows us to _not_ handle some events, like the Copy event. <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References Really heavily inspired by #1349. @DHowett-MSFT thinks we should ship this fix this month an _I agree_. Hence the PR before the spec is finished. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #2285 * [x] I work here * [ ] Tests added/passed - ooh there's an idea <!-- 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 <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed --- <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:06:11 +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#24933