Run a profile as administrator without re-launching Terminal app as admin #17221

Closed
opened 2026-01-31 05:35:51 +00:00 by claunia · 6 comments
Owner

Originally created by @vadimkantorov on GitHub (Apr 11, 2022).

This likely has been discussed before, but I didn't find an existing issue.

If Windows/PowerShell sudo is implemented (https://github.com/microsoft/terminal/issues/146), the need for this is less pertinent. My usecase was opening terminal and hitting wsl --install only to find that I need to re-launch Terminal as admin. It would be nice to allow to re-launch an existing/opened tab as admin without figuring out how to re-launch the whole terminal as admin

Another way may be a button Re-launch as admin (as offered by Process Explorer) - but this is worse compared to launching a specific profile as admin

Originally created by @vadimkantorov on GitHub (Apr 11, 2022). This likely has been discussed before, but I didn't find an existing issue. If Windows/PowerShell sudo is implemented (https://github.com/microsoft/terminal/issues/146), the need for this is less pertinent. My usecase was opening terminal and hitting `wsl --install` only to find that I need to re-launch Terminal as admin. It would be nice to allow to re-launch an existing/opened tab as admin without figuring out how to re-launch the whole terminal as admin Another way may be a button Re-launch as admin (as offered by Process Explorer) - but this is worse compared to launching a specific profile as admin
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 05:35:52 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Apr 11, 2022):

Sorry, but we won't be allowing mixed tabs at different elevation levels. There's more details in https://github.com/microsoft/terminal/blob/main/doc/Niksa.md#elevation, as well as in Elevation Quality of Life Improvements.

In 1.13, you can ctrl+click on a profile to launch it in a new elevated window automatically:
image

/dup #632

@zadjii-msft commented on GitHub (Apr 11, 2022): Sorry, but we won't be allowing mixed tabs at different elevation levels. There's more details in https://github.com/microsoft/terminal/blob/main/doc/Niksa.md#elevation, as well as in [Elevation Quality of Life Improvements](https://github.com/microsoft/terminal/blob/main/doc/specs/%235000%20-%20Process%20Model%202.0/%231032%20-%20Elevation%20Quality%20of%20Life%20Improvements.md#background). In 1.13, you can ctrl+click on a profile to launch it in a new elevated window automatically: ![image](https://user-images.githubusercontent.com/18356694/162817072-e2399cf5-1228-46db-8a1e-0398edab3a2c.png) /dup #632
Author
Owner

@ghost commented on GitHub (Apr 11, 2022):

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 (Apr 11, 2022): 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!
Author
Owner

@vadimkantorov commented on GitHub (Apr 11, 2022):

My main issue is discoverability / UX here.

  1. First-time run of Win11
  2. Open Terminal+PowerShell, run wsl --install, get a "not elevated enough" error argh need to remember how to run Terminal in elevated mode. Maybe the error message could remind of this e.g. say press Win+X and select Windows Terminal +Admin. Or maybe Terminal could detect this error message and highlight it (like it does with links) and allow clicking on it for re-launch as admin. Or maybe the error message could include a special hyper link https://ms-terminal/relauch-as-admin that could be highlighted and actionable
  3. Tooltips are not solving discoverability in full (especially if you're not knowing beforehand where to hover for this message to appear). Maybe worth to have a fully-fledged item in the New-Tab that would in fact launch the profile as admin, but in a new Terminal
  4. Having sudo implemented would also help this particular usecase with WSL installation

Related: https://github.com/microsoft/terminal/issues/1032

@vadimkantorov commented on GitHub (Apr 11, 2022): My main issue is discoverability / UX here. 1. First-time run of Win11 2. Open Terminal+PowerShell, run `wsl --install`, get a "not elevated enough" error argh need to remember how to run Terminal in elevated mode. Maybe the error message could remind of this e.g. say press Win+X and select Windows Terminal +Admin. Or maybe Terminal could detect this error message and highlight it (like it does with links) and allow clicking on it for re-launch as admin. Or maybe the error message could include a special hyper link https://ms-terminal/relauch-as-admin that could be highlighted and actionable 3. Tooltips are not solving discoverability in full (especially if you're not knowing beforehand where to hover for this message to appear). Maybe worth to have a fully-fledged item in the New-Tab that would in fact launch the profile as admin, but in a new Terminal 4. Having sudo implemented would also help this particular usecase with WSL installation Related: https://github.com/microsoft/terminal/issues/1032
Author
Owner

@vadimkantorov commented on GitHub (Apr 29, 2022):

Related: https://github.com/microsoft/terminal/issues/12985#issuecomment-1110868052

@zadjii-msft so it is possible?

@vadimkantorov commented on GitHub (Apr 29, 2022): Related: https://github.com/microsoft/terminal/issues/12985#issuecomment-1110868052 @zadjii-msft so it is possible?
Author
Owner

@zadjii-msft commented on GitHub (Apr 29, 2022):

Ah. To clarify, we're not mixing different permission levels in the same window. I was under the impression that this thread was asking for "I want an admin version of {current profile} in the same window". I'm using that one for "I want an admin version of {current profile} in a new window". Maybe it just took my brain two weeks to tease out the marginal difference between the two 😅

@zadjii-msft commented on GitHub (Apr 29, 2022): Ah. To clarify, we're not mixing different permission levels in the same window. I was under the impression that this thread was asking for "I want an admin version of {current profile} in the same window". I'm using that one for "I want an admin version of {current profile} in a new window". Maybe it just took my brain two weeks to tease out the marginal difference between the two 😅
Author
Owner

@vadimkantorov commented on GitHub (Apr 29, 2022):

You are right, originally I wanted to have re-launch in the same window (or some sort of sudo), but re-launch in a different window from within the app is still more useful than having to remember how to do that in Windows :)

@vadimkantorov commented on GitHub (Apr 29, 2022): You are right, originally I wanted to have re-launch in the same window (or some sort of sudo), but re-launch in a different window from within the app is still more useful than having to remember how to do that in Windows :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17221