Terminal: UI Styling to Clearly Indicate Elevated (admin) Window

Created on 12 Jul 2019  ·  16Comments  ·  Source: microsoft/terminal

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.

Area-User Interface Issue-Feature Product-Terminal

Most helpful comment

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

All 16 comments

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().

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.

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

Maybe use coloring indication? or tabborder painting orangebright red color? (with strong shadows?)
For example, as in debug mode in VS 🤔

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

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

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

see also #3246

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

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

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.

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

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).

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)]

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]

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

Was this page helpful?
0 / 5 - 0 ratings