dotfiles/shells/fish/functions/fish_prompt.fish

17 lines
579 B
Fish
Raw Normal View History

2016-12-14 09:45:28 +01:00
function fish_prompt --description 'Write out the prompt'
2017-05-20 20:23:44 +02:00
# 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 -s)
end
if not set -q __fish_prompt_normal
set -g __fish_prompt_normal (set_color normal)
end
if not set -q __fish_prompt_cwd
set -g __fish_prompt_cwd (set_color $fish_color_cwd)
end
echo -n -s "$USER" @ "$__fish_prompt_hostname" ' ' "$__fish_prompt_cwd" (prompt_pwd) (__fish_vcs_prompt) "$__fish_prompt_normal" '> '
2016-12-14 09:45:28 +01:00
end