diff options
author | 2006-02-04 21:35:12 +1000 | |
---|---|---|
committer | 2006-02-04 21:35:12 +1000 | |
commit | 6920f039eb377ef0b1e8818dee6cdfced0b5e043 (patch) | |
tree | 92dfd3a7cdf003dbb802531ce8c180db6cf0e550 /init | |
parent | ff00354305a0f41c10881c01489506eb844ae27e (diff) |
Minor optimization to the prompt command
darcs-hash:20060204113512-ac50b-4604692cac17972b379a7f40599a30e0bbfc3f89.gz
Diffstat (limited to 'init')
-rw-r--r-- | init/fish_interactive.fish.in | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/init/fish_interactive.fish.in b/init/fish_interactive.fish.in index 8a38509c..acb44c40 100644 --- a/init/fish_interactive.fish.in +++ b/init/fish_interactive.fish.in @@ -26,10 +26,8 @@ end # long it is. function fish_prompt -d (_ "Write out the prompt") - if not set -q __fish_prompt_whoami - set -g __fish_prompt_whoami (whoami) - end - + + # Just calculate these once, to save a few cycles when displaying the prompt if not set -q __fish_prompt_hostname set -g __fish_prompt_hostname (hostname|cut -d . -f 1) end @@ -38,7 +36,9 @@ function fish_prompt -d (_ "Write out the prompt") set -g __fish_prompt_normal (set_color normal) 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 # |