mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-27 11:43:37 +08: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
|
@ -15,7 +15,7 @@ function fish_prompt --description "Write out the prompt"
|
||||||
|
|
||||||
switch $USER
|
switch $USER
|
||||||
|
|
||||||
case root
|
case root toor
|
||||||
|
|
||||||
if not set -q __fish_prompt_cwd
|
if not set -q __fish_prompt_cwd
|
||||||
if set -q fish_color_cwd_root
|
if set -q fish_color_cwd_root
|
||||||
|
|
|
@ -27,7 +27,7 @@ function fish_vi_prompt --description "Simple vi prompt"
|
||||||
|
|
||||||
switch $USER
|
switch $USER
|
||||||
|
|
||||||
case root
|
case root toor
|
||||||
|
|
||||||
if not set -q __fish_prompt_cwd
|
if not set -q __fish_prompt_cwd
|
||||||
if set -q fish_color_cwd_root
|
if set -q fish_color_cwd_root
|
||||||
|
|
|
@ -12,7 +12,7 @@ function fish_prompt --description "Write out the prompt"
|
||||||
|
|
||||||
switch $USER
|
switch $USER
|
||||||
|
|
||||||
case root
|
case root toor
|
||||||
|
|
||||||
if not set -q __fish_prompt_cwd
|
if not set -q __fish_prompt_cwd
|
||||||
if set -q fish_color_cwd_root
|
if set -q fish_color_cwd_root
|
||||||
|
|
|
@ -43,7 +43,7 @@ function fish_prompt --description 'Write out the prompt'
|
||||||
|
|
||||||
switch $USER
|
switch $USER
|
||||||
|
|
||||||
case root
|
case root toor
|
||||||
|
|
||||||
if not set -q __fish_prompt_cwd
|
if not set -q __fish_prompt_cwd
|
||||||
if set -q fish_color_cwd_root
|
if set -q fish_color_cwd_root
|
||||||
|
|
|
@ -22,7 +22,7 @@ function fish_prompt --description 'Write out the prompt'
|
||||||
set -l user_prompt '>'
|
set -l user_prompt '>'
|
||||||
switch $USER
|
switch $USER
|
||||||
# Set our root colors, if we're root :)
|
# Set our root colors, if we're root :)
|
||||||
case root
|
case root toor
|
||||||
set user_prompt '#'
|
set user_prompt '#'
|
||||||
if not set -q __fish_prompt_cwd
|
if not set -q __fish_prompt_cwd
|
||||||
if set -q fish_color_cwd_root
|
if set -q fish_color_cwd_root
|
||||||
|
|
|
@ -31,7 +31,7 @@ function fish_prompt --description 'Write out the prompt, prepending the Debian
|
||||||
|
|
||||||
switch $USER
|
switch $USER
|
||||||
|
|
||||||
case root
|
case root toor
|
||||||
|
|
||||||
if not set -q __fish_prompt_cwd
|
if not set -q __fish_prompt_cwd
|
||||||
if set -q fish_color_cwd_root
|
if set -q fish_color_cwd_root
|
||||||
|
|
|
@ -27,7 +27,7 @@ if not set -q __fish_color_blue
|
||||||
|
|
||||||
switch $USER
|
switch $USER
|
||||||
|
|
||||||
case root
|
case root toor
|
||||||
|
|
||||||
if not set -q __fish_prompt_cwd
|
if not set -q __fish_prompt_cwd
|
||||||
if set -q fish_color_cwd_root
|
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"
|
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
|
end
|
||||||
|
|
|
@ -13,7 +13,7 @@ function fish_prompt
|
||||||
end
|
end
|
||||||
set_color -o green
|
set_color -o green
|
||||||
echo -n [
|
echo -n [
|
||||||
if [ $USER = root ]
|
if test $USER = root -o $USER = toor
|
||||||
set_color -o red
|
set_color -o red
|
||||||
else
|
else
|
||||||
set_color -o yellow
|
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 pwd (echo -n $PWD | sed "s/^$home_escaped/~/" | sed 's/ /%20/g')
|
||||||
set -l prompt_symbol ''
|
set -l prompt_symbol ''
|
||||||
switch $USER
|
switch $USER
|
||||||
case root; set prompt_symbol '#'
|
case root toor; set prompt_symbol '#'
|
||||||
case '*'; set prompt_symbol '$'
|
case '*'; set prompt_symbol '$'
|
||||||
end
|
end
|
||||||
printf "[%s@%s %s%s%s]%s " $USER (hostname -s) (set_color $fish_color_cwd) $pwd (set_color normal) $prompt_symbol
|
printf "[%s@%s %s%s%s]%s " $USER (hostname -s) (set_color $fish_color_cwd) $pwd (set_color normal) $prompt_symbol
|
||||||
|
|
Loading…
Reference in New Issue
Block a user