-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
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 ( 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 tab\border painting orange\bright red color? (with strong shadows?) |
Well, I colour the "PS" text in my custom prompt red when running as admin. |
My idea for an elevated mode design.... if you want to see the design without elevated mode see my other concept: #1375 (comment) |
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. |
The elevated shield should definitely have a higher contrast than what's present in the above mockup. |
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 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. |
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]
|
### ⇒ [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.
## 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)
🎉This issue was addressed in #11224, which has now been successfully released as Handy links: |
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.
The text was updated successfully, but these errors were encountered: