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

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

Closed
askew opened this issue Jul 12, 2019 · 17 comments · Fixed by #11224
Closed

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

askew opened this issue Jul 12, 2019 · 17 comments · Fixed by #11224
Assignees
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@askew
Copy link

askew commented Jul 12, 2019

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.

@askew askew added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Jul 12, 2019
@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 Jul 12, 2019
@Pluc15
Copy link

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

@askew
Copy link
Author

askew commented 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.

@DHowett-MSFT DHowett-MSFT added Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Product-Terminal The new Windows Terminal. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jul 29, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jul 29, 2019
@DHowett-MSFT DHowett-MSFT added this to the Terminal Backlog milestone Jul 29, 2019
@DHowett-MSFT
Copy link
Contributor

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

@0xF6
Copy link

0xF6 commented 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 🤔

@ExE-Boss
Copy link

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

@Fisico
Copy link

Fisico commented 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: #1375 (comment)

@ExE-Boss
Copy link

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

@jirkapok
Copy link

see also #3246

@mdtauk
Copy link

mdtauk commented 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

@ExE-Boss
Copy link

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

@miniksa
Copy link
Member

miniksa commented 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.

@dreadnaut
Copy link

dreadnaut commented 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

@DorsalAxe
Copy link

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

@nurbles
Copy link

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

@dreadnaut
Copy link

dreadnaut commented Apr 2, 2020 via email

@srdjanjovcic
Copy link
Member

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

zadjii-msft added a commit that referenced this issue Aug 25, 2021
### ⇒ [doc link](https://github.com/microsoft/terminal/blob/dev/migrie/s/1032-elevation-qol/doc/specs/%235000%20-%20Process%20Model%202.0/%231032%20-%20Elevation%20Quality%20of%20Life%20Improvements.md) ⇐


## Summary of the Pull Request

Despite my best efforts to mix elevation levels in a single Terminal window, it seems that there's no way to do that safely. With the dream of mixed elevation dead, this spec outlines a number of quality-of-life improvements we can make to the Terminal today. These should make using the terminal in elevated scenarios better, since we can't have M/E.

### Abstract

> For a long time, we've been researching adding support to the Windows Terminal
> for running both unelevated and elevated (admin) tabs side-by-side, in the same
> window. However, after much research, we've determined that there isn't a safe
> way to do this without opening the Terminal up as a potential
> escalation-of-privilege vector.
> 
> Instead, we'll be adding a number of features to the Terminal to improve the
> user experience of working in elevated scenarios. These improvements include:
> 
> * A visible indicator that the Terminal window is elevated ([#1939])
> * Configuring the Terminal to always run elevated ([#632])
> * Configuring a specific profile to always open elevated ([#632])
> * Allowing new tabs, panes to be opened elevated directly from an unelevated
>   window
> * Dynamic profile appearance that changes depending on if the Terminal is
>   elevated or not. ([#1939], [#8311])


## PR Checklist
* [x] Specs: #1032, #632
* [x] References: #5000, #4472, #2227, #7240, #8135, #8311
* [x] I work here

## Detailed Description of the Pull Request / Additional comments
_\*<sup>\*</sup><sub>\*</sub> read the spec  <sub>\*</sub><sup>\*</sup>\*_

### Why are these two separate documents?

I felt that the spec that is currently in review in #7240 and this doc should remain separate, yet closely related documents. #7240 is more about showing how this large set of problems discussed in #5000 can all be solved technically, and how those solutions can be used together. It establishes that none of the proposed solutions for components of #5000 will preclude the possibility of other components being solved. What it does _not_ do however is drill too deeply on the user experience that will be built on top of those architectural changes. 

This doc on the other hand focuses more closely on a pair of scenarios, and establishes how those scenarios will work technically, and how they'll be exposed to the user.
@zadjii-msft zadjii-msft self-assigned this Sep 13, 2021
@ghost ghost added the In-PR This issue has a related PR label Sep 14, 2021
@ghost ghost closed this as completed in #11224 Sep 23, 2021
@ghost ghost removed the In-PR This issue has a related PR label Sep 23, 2021
ghost pushed a commit that referenced this issue Sep 23, 2021
## Summary of the Pull Request

Adds a visible indicator that a Terminal window is elevated. This icon can be disabled with `"showAdminShield" false` in the global settings.

## References

* spec'd in #8455 
* Also in https://github.com/microsoft/terminal/projects/5
* big picture: #5000

## PR Checklist
* [x] Closes #1939
* [x] I work here
* [n/a] Tests added/passed
* [ ] Requires documentation to be updated - yea probably

## Validation Steps Performed

![image](https://user-images.githubusercontent.com/18356694/133293009-4215e319-fbf9-4ca8-8af5-afe2fa8bb62d.png)

![image](https://user-images.githubusercontent.com/18356694/133292970-90cb17fd-16c7-429a-a25f-8457850eb278.png)
@ghost ghost added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Sep 23, 2021
@ghost
Copy link

ghost commented Oct 20, 2021

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

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.