Minor optimization to the prompt command
darcs-hash:20060204113512-ac50b-4604692cac17972b379a7f40599a30e0bbfc3f89.gz
This commit is contained in:
parent
ff00354305
commit
6920f039eb
@ -26,10 +26,8 @@ end
|
|||||||
# long it is.
|
# long it is.
|
||||||
|
|
||||||
function fish_prompt -d (_ "Write out the prompt")
|
function fish_prompt -d (_ "Write out the prompt")
|
||||||
if not set -q __fish_prompt_whoami
|
|
||||||
set -g __fish_prompt_whoami (whoami)
|
# Just calculate these once, to save a few cycles when displaying the prompt
|
||||||
end
|
|
||||||
|
|
||||||
if not set -q __fish_prompt_hostname
|
if not set -q __fish_prompt_hostname
|
||||||
set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
|
set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
|
||||||
end
|
end
|
||||||
@ -38,7 +36,9 @@ function fish_prompt -d (_ "Write out the prompt")
|
|||||||
set -g __fish_prompt_normal (set_color normal)
|
set -g __fish_prompt_normal (set_color normal)
|
||||||
end
|
end
|
||||||
|
|
||||||
printf '%s@%s %s%s%s> \n' $__fish_prompt_whoami $__fish_prompt_hostname (set_color $fish_color_cwd) (prompt_pwd) $__fish_prompt_normal
|
set -l prompt_color (set_color $fish_color_cwd)
|
||||||
|
|
||||||
|
printf '%s@%s %s%s%s> \n' $USER $__fish_prompt_hostname "$prompt_color" (prompt_pwd) "$__fish_prompt_normal"
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user