nixconf/modules/home/core/fish_prompt.fish

23 lines
735 B
Fish

set last_status $status
set -l fish_color_status (set_color green)
test $last_status -eq 0; or set -l fish_color_status (set_color red)
set -l normal (set_color normal)
set -l suffix '->'
if functions -q fish_is_root_user; and fish_is_root_user
set suffix '#'
end
set -l prompt_status $fish_color_status (string pad -w 3 $last_status) $normal
set -l divider (set_color blue) ' ~~ ' $normal
set -x __fish_git_prompt_show_informative_status yes
set -l prompt_nix_shell ''
set -q IN_NIX_SHELL; and set -l prompt_nix_shell "| nixshell"
echo
echo -s '[' $prompt_status '] ' (prompt_hostname) $divider (set_color cyan) (prompt_pwd) $divider (date '+%T') ' ' (fish_vcs_prompt ' ' ) $prompt_nix_shell
echo -s -n $suffix $normal ' '