UI Styling to Clearly Indicate Elevated (admin) Window #2726

Closed
opened 2026-01-30 23:03:19 +00:00 by claunia · 17 comments
Owner

Originally created by @askew on GitHub (Jul 12, 2019).

Originally assigned to: @zadjii-msft on GitHub.

Need to have UI indication that the window was launched elevated.

Issue #632 makes it clear the reason why it's not a good idea to mix elevated/non-elevated tabs, but if you launch a new Terminal using "Run as administrator", there is no indication in the UI that the tabs are running elevated.

Proposed technical implementation details (optional)

Add settings for a separate profile background colour, background image, and ideally title bar differences to be applied when the window in running elevated.

Originally created by @askew on GitHub (Jul 12, 2019). Originally assigned to: @zadjii-msft on GitHub. # Need to have UI indication that the window was launched elevated. Issue #632 makes it clear the reason why it's not a good idea to mix elevated/non-elevated tabs, but if you launch a new Terminal using "Run as administrator", there is no indication in the UI that the tabs are running elevated. # Proposed technical implementation details (optional) Add settings for a separate profile background colour, background image, and ideally title bar differences to be applied when the window in running elevated.
Author
Owner

@Pluc15 commented on GitHub (Jul 17, 2019):

Although I totally see this feature request being useful, here's my Powershell prompt which achieves a similar purpose with a different approach. Simply add it to your Powershell profile (echo $PROFILE).

Function Prompt () {
    If (([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
        Write-Host "[Admin]" -NoNewLine -ForegroundColor "Red"
    }
    Write-Host $env:COMPUTERNAME -NoNewLine -ForegroundColor "White"
    Write-Host ": " -NoNewLine
    Write-Host $pwd.ProviderPath -ForegroundColor "Green"
    Write-Host "PS>" -NoNewLine -ForegroundColor "DarkGray"
    return " "
}

The important part is in the If().

@Pluc15 commented on GitHub (Jul 17, 2019): Although I totally see this feature request being useful, here's my Powershell prompt which achieves a similar purpose with a different approach. Simply add it to your Powershell profile (`echo $PROFILE`). ```powershell Function Prompt () { If (([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { Write-Host "[Admin]" -NoNewLine -ForegroundColor "Red" } Write-Host $env:COMPUTERNAME -NoNewLine -ForegroundColor "White" Write-Host ": " -NoNewLine Write-Host $pwd.ProviderPath -ForegroundColor "Green" Write-Host "PS>" -NoNewLine -ForegroundColor "DarkGray" return " " } ``` The important part is in the If().
Author
Owner

@askew commented on GitHub (Jul 22, 2019):

That's a useful prompt, @Pluc15, I actually ended up doing something similar, but setting the tab title with

$isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) 
$adminText = if ($isAdmin) { '[ADMIN] ' } else { '' }
$host.UI.RawUI.WindowTitle = "$($adminText)Powershell Core ($($PSVersionTable.PSVersion.ToString()))"

However, this needs to be done for every type of shell you might have. It's the host window that has been elevated, so the UI should reflect that.

@askew commented on GitHub (Jul 22, 2019): That's a useful prompt, @Pluc15, I actually ended up doing something similar, but setting the tab title with ```Powershell $isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) $adminText = if ($isAdmin) { '[ADMIN] ' } else { '' } $host.UI.RawUI.WindowTitle = "$($adminText)Powershell Core ($($PSVersionTable.PSVersion.ToString()))" ``` However, this needs to be done for every type of shell you might have. It's the host window that has been elevated, so the UI should reflect that.
Author
Owner

@DHowett-MSFT commented on GitHub (Jul 29, 2019):

This one probably needs a once-over on visual design. Thanks for the request.

@DHowett-MSFT commented on GitHub (Jul 29, 2019): This one probably needs a once-over on visual design. Thanks for the request.
Author
Owner

@0xF6 commented on GitHub (Aug 1, 2019):

Maybe use coloring indication? or tab\border painting orange\bright red color? (with strong shadows?)
For example, as in debug mode in VS 🤔

@0xF6 commented on GitHub (Aug 1, 2019): Maybe use coloring indication? or tab\border painting orange\bright red color? (with strong shadows?) For example, as in debug mode in VS 🤔
Author
Owner

@ExE-Boss commented on GitHub (Aug 15, 2019):

Well, I colour the "PS" text in my custom prompt red when running as admin.

@ExE-Boss commented on GitHub (Aug 15, 2019): Well, I colour the "**PS**" text in my custom prompt red when running as admin.
Author
Owner

@Fisico commented on GitHub (Aug 16, 2019):

windows_terminal_elevated

My idea for an elevated mode design....
Subtle but I think it is enough (Dark and Light Theme).
Also I cleaned up the whole Terminal UI to make it look more modern, clean and fresh. It also uses the space that is available more efficiently, especially the header….

if you want to see the design without elevated mode see my other concept: https://github.com/microsoft/terminal/issues/1375#issuecomment-521774184

@Fisico commented on GitHub (Aug 16, 2019): ![windows_terminal_elevated](https://user-images.githubusercontent.com/329471/63192622-c9221b00-c06b-11e9-9b3c-9c6663aee35a.png) My idea for an elevated mode design.... Subtle but I think it is enough (Dark and Light Theme). Also I cleaned up the whole Terminal UI to make it look more modern, clean and fresh. It also uses the space that is available more efficiently, especially the header…. if you want to see the design without elevated mode see my other concept: https://github.com/microsoft/terminal/issues/1375#issuecomment-521774184
Author
Owner

@ExE-Boss commented on GitHub (Aug 16, 2019):

I recommend also adding the UAC shield to the title bar (probably to the left of the tabs): imageres.dll,78

@ExE-Boss commented on GitHub (Aug 16, 2019): I recommend also adding the UAC shield to the title bar (probably to the left of the tabs): <img alt="imageres.dll,78" width="16" align="bottom" src="https://user-images.githubusercontent.com/3889017/63201134-38a40480-c084-11e9-97ad-f91f8049444d.png" srcset="https://user-images.githubusercontent.com/3889017/63201134-38a40480-c084-11e9-97ad-f91f8049444d.png 16w, https://user-images.githubusercontent.com/3889017/63201135-393c9b00-c084-11e9-88f3-7b50fc5e5179.png 20w, https://user-images.githubusercontent.com/3889017/63201136-393c9b00-c084-11e9-937e-a66739d73c12.png 24w, https://user-images.githubusercontent.com/3889017/63201129-380b6e00-c084-11e9-9098-2aa6dfd14130.png 32w, https://user-images.githubusercontent.com/3889017/63201130-38a40480-c084-11e9-8c16-4d6897769bc5.png 40w, https://user-images.githubusercontent.com/3889017/63201132-38a40480-c084-11e9-9bc7-928a734039e4.png 48w, https://user-images.githubusercontent.com/3889017/63201133-38a40480-c084-11e9-95f3-4f9225ed9afa.png 64w, https://user-images.githubusercontent.com/3889017/63200743-a64f3100-c082-11e9-822d-47b28c5414a8.png"/>
Author
Owner

@jirkapok commented on GitHub (Nov 20, 2019):

see also #3246

@jirkapok commented on GitHub (Nov 20, 2019): see also #3246
Author
Owner

@mdtauk commented on GitHub (Nov 20, 2019):

Having some kind of shield icon to the left of the tabs, may be a better choice. Whatever the design, it needs to work in the Light Theme, Dark Theme, and with the Accent Colour used in the Titlebar. And when you introduce the customising of Tab Colours, any text needs to remain legible and readable.

image

@mdtauk commented on GitHub (Nov 20, 2019): Having some kind of shield icon to the left of the tabs, may be a better choice. Whatever the design, it needs to work in the Light Theme, Dark Theme, and with the Accent Colour used in the Titlebar. And when you introduce the customising of Tab Colours, any text needs to remain legible and readable. ![image](https://user-images.githubusercontent.com/7389110/69242313-8440df80-0b98-11ea-9fa5-bc189889afa4.png)
Author
Owner

@ExE-Boss commented on GitHub (Nov 20, 2019):

The elevated shield should definitely have a higher contrast than what's present in the above mockup.

@ExE-Boss commented on GitHub (Nov 20, 2019): The&nbsp;elevated&nbsp;shield should&nbsp;definitely have&nbsp;a&nbsp;higher&nbsp;contrast than&nbsp;what's&nbsp;present in&nbsp;the&nbsp;above&nbsp;mockup.
Author
Owner

@miniksa commented on GitHub (Nov 26, 2019):

WARNING: This is dev mocking in MSPaint. Please bear with my complete lack of turning a vision into anything aesthetically pleasing.

I think if we're going to use the shield, we should probably use the
image
one from the existing UI toolkit unless there's a non-colorized one that already exists. We would want to maintain consistency with UAC's existing brand if possible.

We should probably also overlay it on the taskbar icon, if we can like
image

Finally, we might have a case where we need to convey other integrity modes like "low box" or "containerzied" for which we could in theory use an icon like
image in the same place (Universal terminal contexts).

Lastly, I want to chime in momentarily on one of the suggestions above:
We will be unable to use a single color on its own as a visual indication of elevation as it violates accessibility guidelines. Indications given with color also need to be given with a shape or description as well so they can be recognized by those who have difficulties with colors or contrasts.

@miniksa commented on GitHub (Nov 26, 2019): WARNING: This is dev mocking in MSPaint. Please bear with my complete lack of turning a vision into anything aesthetically pleasing. I think if we're going to use the shield, we should probably use the ![image](https://user-images.githubusercontent.com/18221333/69656128-d6688180-102c-11ea-8027-2159f4bc549a.png) one from the existing UI toolkit unless there's a non-colorized one that already exists. We would want to maintain consistency with UAC's existing brand if possible. We should probably also overlay it on the taskbar icon, if we can like ![image](https://user-images.githubusercontent.com/18221333/69656645-c1d8b900-102d-11ea-840b-116d72ce4da2.png) Finally, we might have a case where we need to convey other integrity modes like "low box" or "containerzied" for which we could in theory use an icon like ![image](https://user-images.githubusercontent.com/18221333/69656371-48d96180-102d-11ea-91db-eb8c5abbdbfe.png) in the same place (Universal terminal contexts). Lastly, I want to chime in momentarily on one of the suggestions above: We will be unable to use a single color on its own as a visual indication of elevation as it violates accessibility guidelines. Indications given with color also need to be given with a shape or description as well so they can be recognized by those who have difficulties with colors or contrasts.
Author
Owner

@dreadnaut commented on GitHub (Dec 11, 2019):

Another option, and another "dev mock": consider adding some kind of overlay to the background of the terminal area itself. Maybe a shield in a corner, or danger stripes along one of the sides?

image

@dreadnaut commented on GitHub (Dec 11, 2019): Another option, and another "dev mock": consider adding some kind of overlay to the background of the terminal area itself. Maybe a shield in a corner, or danger stripes along one of the sides? ![image](https://user-images.githubusercontent.com/584584/70647432-d7aac880-1c40-11ea-8a7a-08de1fa3246f.png)
Author
Owner

@DorsalAxe commented on GitHub (Jan 11, 2020):

I like the idea of an overlay. Could combine the stripes with a shield icon overlay in the lower right corner just so there is no ambiguity. This would be more elegant and less complicated than messing around colours (which likely isn't going to be colourblind-friendly, which is something that needs to be considered).

@DorsalAxe commented on GitHub (Jan 11, 2020): I like the idea of an overlay. Could combine the stripes with a shield icon overlay in the lower right corner just so there is no ambiguity. This would be more elegant and less complicated than messing around colours (which likely isn't going to be colourblind-friendly, which is something that needs to be considered).
Author
Owner

@nurbles commented on GitHub (Apr 2, 2020):

I would like an option to choose a different color scheme for admin shells, perhaps an adminColorScheme setting? Along with that, there could be an adminName setting as well and perhaps others. Since the tab text automatically has an 'Administrator' prefix added, this would seem to be a relatively easy thing to do.

While I'm here... I know this is probably a Windows thing, but I wish it were easier to launch an admin terminal from the pinned icon on the taskbar.
[EDIT: Thanks for the Ctrl+Shift+Click info! I guess that should've been obvious? (smile)]

@nurbles commented on GitHub (Apr 2, 2020): I would like an option to choose a different color scheme for admin shells, perhaps an `adminColorScheme` setting? Along with that, there could be an `adminName` setting as well and perhaps others. Since the tab text automatically has an 'Administrator' prefix added, this would _seem_ to be a relatively easy thing to do. While I'm here... I know this is probably a Windows thing, but I wish it were easier to launch an admin terminal from the pinned icon on the taskbar. [EDIT: Thanks for the Ctrl+Shift+Click info! I guess that should've been obvious? (smile)]
Author
Owner

@dreadnaut commented on GitHub (Apr 2, 2020):

While I'm here... I know this is probably a Windows thing, but I wish it were easier to launch an admin terminal from the pinned icon on the taskbar.

Hold down Ctrl-Shift when you launch a program!

[edit: well, it's definitely not obvious; but years ago I went looking for all the keyboard shortcuts, and found this: https://support.microsoft.com/en-us/help/12445/windows-keyboard-shortcuts]

@dreadnaut commented on GitHub (Apr 2, 2020): > While I'm here... I know this is probably a Windows thing, but I wish it were easier to launch an admin terminal from the pinned icon on the taskbar. Hold down `Ctrl-Shift` when you launch a program! [edit: well, it's definitely not obvious; but years ago I went looking for all the keyboard shortcuts, and found this: https://support.microsoft.com/en-us/help/12445/windows-keyboard-shortcuts]
Author
Owner

@srdjanjovcic commented on GitHub (May 11, 2020):

I see that we got "Administrator: " prefix in title of elevated Terminal. That's good, but it would be great if elevated and non-elevated instances of wt.exe would be gathered together in taskbar, and elevated to have elevation shield overlay, like this:

image

@srdjanjovcic commented on GitHub (May 11, 2020): I see that we got "Administrator: " prefix in title of elevated Terminal. That's good, but it would be great if elevated and non-elevated instances of wt.exe would be gathered together in taskbar, and elevated to have elevation shield overlay, like this: ![image](https://user-images.githubusercontent.com/15749816/81601665-1d9ac280-9380-11ea-8ca7-f92791ae5590.png)
Author
Owner

@ghost commented on GitHub (Oct 20, 2021):

:tada:This issue was addressed in #11224, which has now been successfully released as Windows Terminal Preview v1.12.2922.0.🎉

Handy links:

@ghost commented on GitHub (Oct 20, 2021): :tada:This issue was addressed in #11224, which has now been successfully released as `Windows Terminal Preview v1.12.2922.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.12.2922.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#2726