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

Figure out how to handle drag-drop in an elevated session #6661

Open
DasCleverle opened this issue Jun 24, 2020 · 15 comments
Open

Figure out how to handle drag-drop in an elevated session #6661

DasCleverle opened this issue Jun 24, 2020 · 15 comments
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal External-Blocked-WinUI3 We can't progress until WinUI3 exists. Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Milestone

Comments

@DasCleverle
Copy link

Environment

Windows build number: 19041
Windows Terminal version: 1.0.1401.0

Steps to reproduce

  • Open Windows Terminal
  • Open a second tab (the shell does not matter)
  • Try to drag any tab

Expected behavior

Tabs are attached to the mouse cursor and can be dragged to the desired location.

Actual behavior

Nothing happens
EPSXa3QONG

I can only reproduce this issue on my work PC. My private PC works just fine. They use the exact same settings file. Also restarting the computer or reinstalling WT does not help.

@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 Jun 24, 2020
@zadjii-msft
Copy link
Member

Are you running the Terminal elevated / as an Administrator?

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jun 24, 2020
@DasCleverle
Copy link
Author

DasCleverle commented Jun 24, 2020

Yes, that seems to be it.
If I start it elevated on my private PC it also stops working. But on my work PC it seems to run elevated by default (UAC is configured to not show a prompt). Is there a way to disable it? As I'm working nearly exclusively in WSL, I don't really need to have it run as admin.

/edit
I can't enable UAC as some group policy scripts run regedit on startup and I get like 10 prompts when I log in.

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jun 24, 2020
@DHowett
Copy link
Member

DHowett commented Jun 26, 2020

So, okay, here's a weird thing.

We are working around a crash (!) caused by the drag/drop host being at a different integrity level than the Terminal application. I know, that sounds silly. I agree.

Now, the problem here is that since your entire user session has UAC disabled, there is no integrity level separation. Drag/drop would work perfectly fine for you!

Unfortunately, we have no way of knowing that. All we can check is "does this user have admin rights?" without really violating the bounds of our contract with the system.

I'm going to make this bug the master for "figure out a good story for drag/drop during elevation".

@DHowett DHowett added Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Product-Terminal The new Windows Terminal. Area-User Interface Issues pertaining to the user interface of the Console or Terminal and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Attention The core contributors need to come back around and look at this ASAP. labels Jun 26, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jun 26, 2020
@DHowett DHowett added this to the Terminal Backlog milestone Jun 26, 2020
@DHowett DHowett changed the title Unable to drag and drop tabs Figure out how to handle drag-drop in an elevated session Jun 26, 2020
@conioh
Copy link

conioh commented Oct 3, 2020

So, okay, here's a weird thing.

We are working around a crash (!) caused by the drag/drop host being at a different integrity level than the Terminal application. I know, that sounds silly. I agree.

Now, the problem here is that since your entire user session has UAC disabled, there is no integrity level separation. Drag/drop would work perfectly fine for you!

Unfortunately, we have no way of knowing that. All we can check is "does this user have admin rights?" without really violating the bounds of our contract with the system.

I'm going to make this bug the master for "figure out a good story for drag/drop during elevation".

Could you elaborate on this? Is it related to your use of XAML islands?

I remember earlier preview versions crashing immediately when I tried to drag admin tabs. Not crashing is better than crashing, but being able to drag them would be even better. :)

@sba923
Copy link

sba923 commented Mar 4, 2022

Would there be a way to inform the user this is (currently) not supported, some visual clue maybe?

@zadjii-msft
Copy link
Member

I'm pretty sure when you try to drag/drop into an elevated Terminal window, the OS automatically replaces the drag/drop visual with the 🚫 icon to indicate that this isn't supported

@dracan
Copy link

dracan commented Sep 15, 2022

Just wondering if there's been any further development with this? I find the ability to reorder tabs extremely useful, and I quite often have my WT run as admin. It's quite frustrating not being able to reorder just because I'm in an elevated prompt.

@zadjii-msft
Copy link
Member

zadjii-msft commented Jan 16, 2023

@dracan Heyo sorry, missed this while I was on leave and only just finding this comment now.

No, unfortunately, there hasn't been any progress on drag/drop in elevated windows. Alas, that's not something we have a lot of power over. (Note to self, this is tracked in MSFT:35616520)

Now, on the bright side, there is a workaround for moving tabs without using drag/drop. There's a pair of actions in the Command Palette for "Move tab forward" / "Move tab backward" which will reorder your tabs without the need to invoke the drag/drop service. That might be a possible workaround.

Docs link


More internal links, for self:

@dracan
Copy link

dracan commented Jan 16, 2023

@zadjii-msft - Perfect! I never like reaching for that darn mouse anyway - so hotkeys work perfectly. Thank you very much 🙂🙏

@conioh

This comment was marked as off-topic.

@zadjii-msft

This comment was marked as off-topic.

@conioh

This comment was marked as off-topic.

@dracan
Copy link

dracan commented Jan 18, 2023

@conioh - Sounds like you're suggesting a codebase re-write of all of WT to use a different platform just to fix this small issue of tab drag-and-drop when running as admin? That sounds like a MASSIVE undertaking to me just to fix this one thing!

@conioh
Copy link

conioh commented Nov 7, 2023

Sounds like you're suggesting a codebase re-write of all of WT to use a different platform just to fix this small issue of tab drag-and-drop when running as admin? That sounds like a MASSIVE undertaking to me just to fix this one thing!

@dracan:

Only to someone who's not really listening. Actually it sounds like I'm suggesting a search-and-replace of just a tiny edge of Windows Terminal - wherever it says Microsoft.UI.Xaml etc. (WinUI 3) replace it with Windows.UI.Xaml etc. (UWP). Calling it a "re-write of all of WT" and "a MASSIVE undertaking" is misleading, disingenuous, and incompatible with the project's CoC. I must request you to refrain from doing that.

See https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/migrate-to-windows-app-sdk/migrate-to-windows-app-sdk-ovw

Just perform the equivalent of the 3 steps Microsoft officially suggests in the reverse direction:

  1. Create a new UWP project WinUI 3 packaged desktop project (see Create your first WinUI 3 project). That could go into your existing solution.
  2. Copy your XAML/UI code. In many cases you can simply change namespaces (for example, Microsoft.UI.* to Windows.UI.* Windows.UI.* to Microsoft.UI.*).
  3. Copy your app logic code. Some APIs need tweaks, such as Popup, Pickers, and SecondaryTiles.

@DHowett
Copy link
Member

DHowett commented Nov 7, 2023

@conioh Windows Terminal does not currently use WinUI 3 or WinAppSDK. It uses system XAML (built into Windows) plus Microsoft.UI.Xaml (WinUI 2) controls.

Moving the application from System XAML plus WinUI2 to System XAML only1 and packaging it as a "UWP" application (which runs at an integrity level that is inappropriate for the basic system management tasks Terminal is used to run (which is important because Terminal needs to spawn processes, which would be sandbox-restricted)) would present a significant regression in usability, deployment and project direction.

In addition, it is not a simple search and replace--especially given that the Windows.UI.Xaml namespace doesn't have many of the controls which we are using (including the TabView, which is responsible for most of the actual UI 😆).

We're just not going to do that, because on top of being a significant undertaking it will send us back to the halcyon days of 2016.

Going the other direction:

Moving the application from System XAML plus WinUI 2 to WinUI 3 where the drag-drop issue is expected to be fixed is also a significant undertaking.

Anyway, this discussion is not going anywhere. I'm going to lock it for a while.

Footnotes

  1. moving from whichever parts of Microsoft.UI.Xaml we are using to Windows.UI.Xaml as you recommend

@microsoft microsoft locked as too heated and limited conversation to collaborators Nov 7, 2023
@zadjii-msft zadjii-msft added the External-Blocked-WinUI3 We can't progress until WinUI3 exists. label May 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal External-Blocked-WinUI3 We can't progress until WinUI3 exists. Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

6 participants