Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drag and drop from File Explorer should put full path at cursor location in Windows Terminal #904

Closed
DJackman123 opened this issue May 20, 2019 · 7 comments · Fixed by #4323
Labels
Area-Interaction Interacting with the vintage console window (as opposed to driving via API or hooks) Help Wanted We encourage anyone to jump in on these. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@DJackman123
Copy link
Contributor

Summary of the new feature/enhancement

Drag and drop of file or folder from File Explorer should behave the same way that it does in conhost. Conhost will add the text of the full path of the item dropped at the current cursor location.

Proposed technical implementation details (optional)

@DJackman123 DJackman123 added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label May 20, 2019
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 20, 2019
@DHowett-MSFT DHowett-MSFT added Product-Terminal The new Windows Terminal. Area-Interaction Interacting with the vintage console window (as opposed to driving via API or hooks) and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels May 20, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 20, 2019
@DHowett-MSFT
Copy link
Contributor

Ref. #331 for linking purposes.
Thanks!

@RobertBernstein
Copy link

I'm just wondering if there's any update on when this will be enabled. I saw that there are issues with capturing path information under WSL, but will this be implemented for cmd.exe and/or PowerShell anytime soon? Thanks!

@zadjii-msft
Copy link
Member

@RobertBernstein At the time of writing, this particular feature hasn't had any progress. It's still sitting on our backlog - it's something that we want to do, but we unfortunately don't think we'll be able to get to before the 1.0 release of the Terminal. We'd be happy to accept a community contribution for this feature!

There's code in Window::_HandleDrop in the conhost code in this repo that already handles a WM_DROPFILES message, it shouldn't be too hard to add a similar listener to the IslandWindow class that writes the path to the input of the TerminalApp.

@ghost ghost added the In-PR This issue has a related PR label Jan 21, 2020
@ghost ghost closed this as completed in #4323 Jan 30, 2020
@ghost ghost removed the In-PR This issue has a related PR label Jan 30, 2020
ghost pushed a commit that referenced this issue Jan 30, 2020
## 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.
@ghost ghost added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Jan 30, 2020
@jingyu9575
Copy link

Hi, I've downloaded today's CI build to try this new feature. It sometimes works but randomly stops working. Strangely, the success rate has a noticeable increase if initialCols <= 63:

rDrkDxyqkU

Also, some area is not available for dropping, which I suspect to be related with the DPI scaling (I use 150%).

xuNyAiIRSd

Thank you!

@ghost
Copy link

ghost commented Feb 13, 2020

🎉This issue was addressed in #4323, which has now been successfully released as Windows Terminal Preview v0.9.433.0.:tada:

Handy links:

@SJang1
Copy link

SJang1 commented Feb 13, 2020

@jingyu9575 Maybe opening a new issue?

@jingyu9575
Copy link

@SJang1 In today's release, I cannot reproduce the first problem, but the second one is still not fixed. I've opened a new issue #4567.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Interaction Interacting with the vintage console window (as opposed to driving via API or hooks) Help Wanted We encourage anyone to jump in on these. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants