Closed Genesis-Nova closed 3 years ago
This is standard across the entire OS. Unfortunately, the only accepted way to get a file path into an elevated application (even notepad!) is by using the clipboard (in Terminal's case) or the File>Open dialog.
This is a security measure implemented in Windows itself -- drag/drop is a form of messaging between applications, and messaging between non-admin and admin windows is very restricted.
Well like in the ticket I listed, 6661, I'm running with uac off so there is no integrity level separation so I just thought I'd bring it up.
Interesting! That would have been important to mention. I'll reopen this while we think about what's intended behavior.
@Genesis-Nova Hey just to be sure I'm fixing this correctly, how did you disable UAC? Just by sliding the User Account Control slider all the way down, or by setting EnableLUA
to 0 in the registry? I think I have a way to detect the second scenario, but not the first.
:tada:This issue was addressed in #11221, which has now been successfully released as Windows Terminal Preview v1.12.2922.0
.:tada:
Handy links:
Using version 1.15.3466.0 in Windows 11 but this issue has NOT been fixed. Rearranging tabs with UAC disabled works but not drag and dropping files.
We should reopen this issue!
@bpsib has already said that this problem should be divided into 2 parts: dragging TABS & dragging FILES.
I can also confirm, on Windows 11, all the way from 22000.XXX to latest 25309, dragging files to Windows Terminal NEVER worked.
We don't know why @zadjii-msft closed this issue last year, but currently I highly doubt this problem is Windows Terminal-specific: The New Notepads uses exactly the same Tab pages provided by WinUI3, and it support drag & drop files under EnableLUA=0 out of box.
PS1: I've debugged the Windows Terminal, the DragOver callback never triggers under EnableLUA=0 PS2: New Notepad does not uses DataExchangeHost, it's receiving WM_DROPFILES and using DragQueryFile to handle the file dropping
My environment:
wt 1.17.230526001 zip version
uac dragged to the bottom
EnableLUA=0
Run profile as administrator (even if this option is not enabled, it still runs as administrator, possibly because I turned off EnableLUA)
I still can't drag files, it shows the prohibited symbol.
Is this issue resolved?
@antnesswcm I'm pretty sure this was more correctly fixed in #14946, which was shipped in 1.18.
@zadjii-msft Let me explain "more correctly fixed" more precisely.
The #14946 fixes drag & drop initiatied from Windows Terminal (e.g. drag & drop tabs).
But it DOES NOT fix the case when user drags files from other application to Windows Terminal.
AFAIK, this is problem in Windows.UI.Xaml, which DataExchangeHost refuses to pass on drag event, even if there's actually no limitation.
Here I sincerely ask for @zadjii-msft 's help:
Also I've pinpointed the problem & made a hook fix:
https://github.com/NyaMisty/PunchDataExchangeHost
With this, DataExchangeHost will be able to properly handle drag requests even when UAC disabled.
@antnesswcm probably you can also have a try
Also I've pinpointed the problem & made a hook fix:
https://github.com/NyaMisty/PunchDataExchangeHost
With this, DataExchangeHost will be able to properly handle drag requests even when UAC disabled.
@antnesswcm probably you can also have a try
This is fantastic @NyaMisty, works perfectly in my limited testing.
I run terminal as admin (I'm on Windows 10, version 22H2/build 19045.4046), and can confirm that this is broken even if UAC is on. I was literally just looking it up to see if anyone had a solution.
It still doesn't work.
Also I've pinpointed the problem & made a hook fix:
https://github.com/NyaMisty/PunchDataExchangeHost
With this, DataExchangeHost will be able to properly handle drag requests even when UAC disabled.
@antnesswcm probably you can also have a try
Would recommend anyone having the drag-drop issue try this. This is in no way, shape, or form related to dragging tabs, this is related to dragging files into terminal and having it work as it does for a normal cmd or powershell window.
Windows Version 10.0.19042.0 Terminal Version 1.3.2651
Any other software? None open at the time
Steps to reproduce
Run windows terminal as administrator. Try to drag a file/folder into the terminal to copy its path to the terminal window. Does not work.
Expected behavior
I expected drag and drop for files/folders into the terminal window to behave the same as a command prompt or powershell window, both behave as expected in non-admin or administrator permission instances of the aforementioned programs.
Actual behavior
Path does not get copied during drag and drop into the terminal window, I just get the "deny" "not allowed" cursor icon when trying, unsure if this is related to the ongoing issue of being unable to rearrange tabs while in an admin window or not as seen in #6661