mirror of
https://github.com/starship/starship.git
synced 2026-06-22 02:02:12 +07:00
feat(username): Detect Admin access in Windows (#2791)
* Detect Admin access in Windows * Update username doc * Do not run tests when elevated * Add comment * Try fixing tests * use deelevate crate * simplify cfg * Update src/modules/username.rs Fix rookie mistake Co-authored-by: David Knaack <davidkna@users.noreply.github.com> * handle errors * fix lockfile error Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
This commit is contained in:
@@ -3435,7 +3435,7 @@ time_range = "10:00:00-14:00:00"
|
||||
The `username` module shows active user's username.
|
||||
The module will be shown if any of the following conditions are met:
|
||||
|
||||
- The current user is root
|
||||
- The current user is root/admin
|
||||
- The current user isn't the same as the one that is logged in
|
||||
- The user is currently connected as an SSH session
|
||||
- The variable `show_always` is set to true
|
||||
@@ -3450,13 +3450,13 @@ these variables, one workaround is to set one of them with a dummy value.
|
||||
|
||||
### Options
|
||||
|
||||
| Option | Default | Description |
|
||||
| ------------- | ----------------------- | ------------------------------------- |
|
||||
| `style_root` | `"bold red"` | The style used when the user is root. |
|
||||
| `style_user` | `"bold yellow"` | The style used for non-root users. |
|
||||
| `format` | `"[$user]($style) in "` | The format for the module. |
|
||||
| `show_always` | `false` | Always shows the `username` module. |
|
||||
| `disabled` | `false` | Disables the `username` module. |
|
||||
| Option | Default | Description |
|
||||
| ------------- | ----------------------- | ------------------------------------------- |
|
||||
| `style_root` | `"bold red"` | The style used when the user is root/admin. |
|
||||
| `style_user` | `"bold yellow"` | The style used for non-root users. |
|
||||
| `format` | `"[$user]($style) in "` | The format for the module. |
|
||||
| `show_always` | `false` | Always shows the `username` module. |
|
||||
| `disabled` | `false` | Disables the `username` module. |
|
||||
|
||||
### Variables
|
||||
|
||||
|
||||
Reference in New Issue
Block a user