mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Add support for toor account.
Currently fish doesn't recognize toor as special. However, it's likely that on BSD systems, fish shell will be used on toor, not on root (toor is an intentionally existing account to use more advanced shell on, like shell).
This commit is contained in:
parent
5591afff6e
commit
6c80a3461c
9 changed files with 10 additions and 10 deletions
|
@ -15,7 +15,7 @@ function fish_prompt --description "Write out the prompt"
|
|||
|
||||
switch $USER
|
||||
|
||||
case root
|
||||
case root toor
|
||||
|
||||
if not set -q __fish_prompt_cwd
|
||||
if set -q fish_color_cwd_root
|
||||
|
|
|
@ -27,7 +27,7 @@ function fish_vi_prompt --description "Simple vi prompt"
|
|||
|
||||
switch $USER
|
||||
|
||||
case root
|
||||
case root toor
|
||||
|
||||
if not set -q __fish_prompt_cwd
|
||||
if set -q fish_color_cwd_root
|
||||
|
|
|
@ -12,7 +12,7 @@ function fish_prompt --description "Write out the prompt"
|
|||
|
||||
switch $USER
|
||||
|
||||
case root
|
||||
case root toor
|
||||
|
||||
if not set -q __fish_prompt_cwd
|
||||
if set -q fish_color_cwd_root
|
||||
|
|
|
@ -43,7 +43,7 @@ function fish_prompt --description 'Write out the prompt'
|
|||
|
||||
switch $USER
|
||||
|
||||
case root
|
||||
case root toor
|
||||
|
||||
if not set -q __fish_prompt_cwd
|
||||
if set -q fish_color_cwd_root
|
||||
|
|
|
@ -22,7 +22,7 @@ function fish_prompt --description 'Write out the prompt'
|
|||
set -l user_prompt '>'
|
||||
switch $USER
|
||||
# Set our root colors, if we're root :)
|
||||
case root
|
||||
case root toor
|
||||
set user_prompt '#'
|
||||
if not set -q __fish_prompt_cwd
|
||||
if set -q fish_color_cwd_root
|
||||
|
|
|
@ -31,7 +31,7 @@ function fish_prompt --description 'Write out the prompt, prepending the Debian
|
|||
|
||||
switch $USER
|
||||
|
||||
case root
|
||||
case root toor
|
||||
|
||||
if not set -q __fish_prompt_cwd
|
||||
if set -q fish_color_cwd_root
|
||||
|
|
|
@ -27,7 +27,7 @@ if not set -q __fish_color_blue
|
|||
|
||||
switch $USER
|
||||
|
||||
case root
|
||||
case root toor
|
||||
|
||||
if not set -q __fish_prompt_cwd
|
||||
if set -q fish_color_cwd_root
|
||||
|
@ -48,4 +48,4 @@ if not set -q __fish_prompt_cwd
|
|||
printf '[%s] %s%s@%s %s%s %s(%s)%s \f\r> ' (date "+%H:%M:%S") "$__fish_color_blue" $USER $__fish_prompt_hostname "$__fish_prompt_cwd" (pwd) "$__fish_color_status" "$stat" "$__fish_prompt_normal"
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,7 +13,7 @@ function fish_prompt
|
|||
end
|
||||
set_color -o green
|
||||
echo -n [
|
||||
if [ $USER = root ]
|
||||
if test $USER = root -o $USER = toor
|
||||
set_color -o red
|
||||
else
|
||||
set_color -o yellow
|
||||
|
|
|
@ -6,7 +6,7 @@ function fish_prompt -d "Write out the prompt"
|
|||
set -l pwd (echo -n $PWD | sed "s/^$home_escaped/~/" | sed 's/ /%20/g')
|
||||
set -l prompt_symbol ''
|
||||
switch $USER
|
||||
case root; set prompt_symbol '#'
|
||||
case root toor; set prompt_symbol '#'
|
||||
case '*'; set prompt_symbol '$'
|
||||
end
|
||||
printf "[%s@%s %s%s%s]%s " $USER (hostname -s) (set_color $fish_color_cwd) $pwd (set_color normal) $prompt_symbol
|
||||
|
|
Loading…
Reference in a new issue