mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-09 12:11:20 -03:00
Add a function to check if the user is root.
Add a helper function to check if the user is root. This function can be useful for the prompts for example. Modify the prompts made root checked to use the function instead. Add also the support of Administrator like a root user. Fixes: #7031
This commit is contained in:
committed by
Fabian Homborg
parent
de9e8cb897
commit
e2f03fa8a7
@@ -9,7 +9,7 @@ function fish_prompt --description 'Write out the prompt'
|
||||
# Color the prompt differently when we're root
|
||||
set -l color_cwd $fish_color_cwd
|
||||
set -l suffix '>'
|
||||
if contains -- $USER root toor
|
||||
if fish_is_root_user
|
||||
if set -q fish_color_cwd_root
|
||||
set color_cwd $fish_color_cwd_root
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user