Allow drag-drop on title bar to run that file in Terminal #8087

Closed
opened 2026-01-31 01:20:26 +00:00 by claunia · 2 comments
Owner

Originally created by @ffes on GitHub (May 12, 2020).

Description of the new feature/enhancement

When I drop for instance a .bat file on the title bar that file should be run as a new tab in Terminal.

I often have a collection of .bat files to perform tasks while developing. When I double click those file they are started in conhost and thus opening a new window. This is not always what you want. If I was able to drop the file on the title bar of Terminal and it would run the script as a new tab in Terminal it could really help. For instance a command like docker run php:apache (within a .bat file with lots of options) can run for quite some time for a web developer.

Since the Windows Explorer knows how to open a .bat or .ps1 file, it can't be too hard for Terminal to do "the same".

It would be perfect if I can drag to the title bar, hover over the chevron, that menu is opened and I can drop on the entry I want. I have a regular cmd and a VS2019 Developer cmd profile. Or to allow dropping a .sh on different WSL distros.

Know that this requested feature does not interfere with the existing "drop and paste the filename" feature. This one is about dropping on the title bar and not on the terminal window itself.

For security reasons, you could limit it to a certain set of configurable default file extensions.

You want to be able to add extensions to a profile, so Terminal knows which profile to use for a certain file extension.

"droppedExtensions": [ "bat", "cmd" ]

When you drop on an existing tab it should still be opening a new tab, maybe of the same profile you dropped it on.

Originally created by @ffes on GitHub (May 12, 2020). # Description of the new feature/enhancement When I drop for instance a `.bat` file on the title bar that file should be run as a new tab in Terminal. I often have a collection of `.bat` files to perform tasks while developing. When I double click those file they are started in conhost and thus opening a new window. This is not always what you want. If I was able to drop the file on the title bar of Terminal and it would run the script as a new tab in Terminal it could really help. For instance a command like `docker run php:apache` (within a `.bat` file with lots of options) can run for quite some time for a web developer. Since the Windows Explorer knows how to open a `.bat` or `.ps1` file, it can't be too hard for Terminal to do "the same". It would be perfect if I can drag to the title bar, hover over the chevron, that menu is opened and I can drop on the entry I want. I have a regular `cmd` and a `VS2019 Developer cmd` profile. Or to allow dropping a `.sh` on different WSL distros. Know that this requested feature does not interfere with the existing "drop and paste the filename" feature. This one is about dropping on the title bar and not on the terminal window itself. For security reasons, you could limit it to a certain set of configurable default file extensions. You want to be able to add extensions to a profile, so Terminal knows which profile to use for a certain file extension. ```json "droppedExtensions": [ "bat", "cmd" ] ``` When you drop on an existing tab it should still be opening a new tab, maybe of the same profile you dropped it on.
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 01:20:26 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (May 15, 2020):

@ffes thanks for the request! I appreciate how this would improve your workflow, but I think what you're really hoping for is #492.

Being able to drop script files onto Windows Terminal sounds like a great idea, but I'm worried about the can of worms it opens. I'd immediately want to know, "which WSL distribution runs the .sh file when I drop it", or "how do I specify which version of Python or PowerShell to use?"

I'd also be worried about having an RPC mechanism (which is what drag/drop is) that allows any process on the system to ask WT to execute something on its behalf.

I think that most of these concerns go away when console applications automatically launch inside WT (either the current instance or a new one), which is what 492 will affect.

I'm closing this one out as a spiritual /dupe of #492.

@DHowett-MSFT commented on GitHub (May 15, 2020): @ffes thanks for the request! I appreciate how this would improve your workflow, but I think what you're really hoping for is #492. Being able to drop script files onto Windows Terminal sounds like a great idea, but I'm worried about the can of worms it opens. I'd immediately want to know, "which WSL distribution runs the `.sh` file when I drop it", or "how do I specify which version of Python or PowerShell to use?" I'd also be worried about having an RPC mechanism (which is what drag/drop is) that allows any process on the system to ask WT to execute something on its behalf. I think that most of these concerns go away when console applications automatically launch inside WT (either the current instance or a new one), which is what 492 will affect. I'm closing this one out as a _spiritual /dupe of #492_.
Author
Owner

@ghost commented on GitHub (May 15, 2020):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (May 15, 2020): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8087