[PR #4323] [MERGED] Add support for dragging and dropping paths onto the Terminal #25714

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4323
Author: @zadjii-msft
Created: 1/21/2020
Status: Merged
Merged: 1/30/2020
Merged by: @undefined

Base: masterHead: dev/migrie/f/904-drag-path


📝 Commits (10+)

  • 754ead8 Add support for dragging and dropping paths onto the Terminal
  • c473d54 Merge branch 'master' into dev/migrie/f/904-drag-path
  • 08c7129 Why doesn't this work??
  • aefd6d9 do the UWP drag-drop instead
  • f468a4f Remove some code that's no longer needed
  • 695b2ee Merge remote-tracking branch 'origin/master' into dev/migrie/f/904-drag-path
  • 0d734d8 Revert a bunch of changes that weren't needed anymore
  • b0ec743 Merge remote-tracking branch 'origin/master' into dev/migrie/f/904-drag-path
  • c17cc3d nits from pr
  • 5ac347f Write all the files to the terminal for @dhowett-msft

📊 Changes

4 files changed (+137 additions, -28 deletions)

View changed files

📝 src/cascadia/TerminalControl/Resources/en-US/Resources.resw (+31 -28)
📝 src/cascadia/TerminalControl/TermControl.cpp (+101 -0)
📝 src/cascadia/TerminalControl/TermControl.h (+3 -0)
📝 src/cascadia/TerminalControl/pch.h (+2 -0)

📄 Description

Summary of the Pull Request

I took the code from conhost that handles this and just copy-pasted it into the terminal codebase.

References

Original conhost code:
027f1228cb/src/interactivity/win32/windowproc.cpp (L854-L889)

PR Checklist

Detailed Description of the Pull Request / Additional comments

Okay it was a little more complicated than that. I had IslandWindow handle the drop, which then raises a generic event for AppHost to handle. AppHost handles this by writing the path as input to the terminal, traversing AppLogic, TerminalPage and finally landing in TermControl

Validation Steps Performed

Tested manually with both paths with and without spaces.


🔄 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/4323 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 1/21/2020 **Status:** ✅ Merged **Merged:** 1/30/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/migrie/f/904-drag-path` --- ### 📝 Commits (10+) - [`754ead8`](https://github.com/microsoft/terminal/commit/754ead82349e039a6ce33ea5cde4ed49ebe63258) Add support for dragging and dropping paths onto the Terminal - [`c473d54`](https://github.com/microsoft/terminal/commit/c473d54d08dc168e462fb7ef5bbcbb51a1618173) Merge branch 'master' into dev/migrie/f/904-drag-path - [`08c7129`](https://github.com/microsoft/terminal/commit/08c712982dfc415a1f5db3a86e3253ec1ea1666e) Why doesn't this work?? - [`aefd6d9`](https://github.com/microsoft/terminal/commit/aefd6d97a37f2b8c468c91857ca584361e31bcec) do the UWP drag-drop instead - [`f468a4f`](https://github.com/microsoft/terminal/commit/f468a4fa78f70b6028c16f59fc735ff39524311b) Remove some code that's no longer needed - [`695b2ee`](https://github.com/microsoft/terminal/commit/695b2ee772242ee9a5b3e87f8554633ef4585067) Merge remote-tracking branch 'origin/master' into dev/migrie/f/904-drag-path - [`0d734d8`](https://github.com/microsoft/terminal/commit/0d734d80057376598c532ce774e08f171935c435) Revert a bunch of changes that weren't needed anymore - [`b0ec743`](https://github.com/microsoft/terminal/commit/b0ec743a79ee6646b411b38754b0cde30a3a6b23) Merge remote-tracking branch 'origin/master' into dev/migrie/f/904-drag-path - [`c17cc3d`](https://github.com/microsoft/terminal/commit/c17cc3df30367f5ef5e0f8bd7e193eabc00c9a0f) nits from pr - [`5ac347f`](https://github.com/microsoft/terminal/commit/5ac347ffa7f6e8a404167ef84f4cbd1bbe531d1b) Write _all_ the files to the terminal for @dhowett-msft ### 📊 Changes **4 files changed** (+137 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/Resources/en-US/Resources.resw` (+31 -28) 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+101 -0) 📝 `src/cascadia/TerminalControl/TermControl.h` (+3 -0) 📝 `src/cascadia/TerminalControl/pch.h` (+2 -0) </details> ### 📄 Description ## Summary of the Pull Request I took the code from conhost that handles this and just copy-pasted it into the terminal codebase. ## References Original conhost code: https://github.com/microsoft/terminal/blob/027f1228cb92746de102f04c491ac02b98708bf2/src/interactivity/win32/windowproc.cpp#L854-L889 ## PR Checklist * [x] Closes #904 * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments Okay it was a little more complicated than that. I had `IslandWindow` handle the drop, which then raises a generic event for `AppHost` to handle. `AppHost` handles this by writing the path as input to the terminal, traversing `AppLogic`, `TerminalPage` and finally landing in `TermControl` ## Validation Steps Performed Tested manually with both paths with and without spaces. --- <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:11:19 +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#25714