fish: Better prompt for root
This commit is contained in:
parent
ec8b51c80f
commit
300eab47a3
4 changed files with 6 additions and 19 deletions
|
@ -1,16 +1,9 @@
|
|||
function fish_prompt --description 'Write out the prompt'
|
||||
set -l color_cwd
|
||||
set -l suffix
|
||||
switch "$USER"
|
||||
case root toor
|
||||
if set -q fish_color_cwd_root
|
||||
set color_cwd $fish_color_cwd_root
|
||||
else
|
||||
set color_cwd $fish_color_cwd
|
||||
end
|
||||
set suffix '#'
|
||||
set suffix (set_color ff0000)'#'
|
||||
case '*'
|
||||
set color_cwd $fish_color_cwd
|
||||
set suffix '>'
|
||||
end
|
||||
|
||||
|
@ -24,6 +17,6 @@ function fish_prompt --description 'Write out the prompt'
|
|||
end
|
||||
|
||||
echo -n -s (set_color $fish_color_host) (prompt_hostname) ' ' \
|
||||
(set_color $color_cwd) (prompt_pwd) (string join "" $vcs) \
|
||||
(set_color $fish_color_cwd) (prompt_pwd) (string join "" $vcs) \
|
||||
(set_color $fish_color_suffix) "$suffix "
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue