Mercurial > dotfiles
diff dot_config/private_fish/functions/fish_prompt.fish @ 1038:6ab26ddbf78d
feat: add fish shell
author | Zeger Van de Vannet <zeger@vandevan.net> |
---|---|
date | Fri, 26 Apr 2024 18:43:22 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dot_config/private_fish/functions/fish_prompt.fish Fri Apr 26 18:43:22 2024 +0200 @@ -0,0 +1,24 @@ +set fish_prompt_pwd_dir_length 2 +set -g fish_prompt_pwd_full_dirs 5 +function fish_prompt + set -l last_pipestatus $pipestatus + set -lx __fish_last_status $status # Export for __fish_print_pipestatus. + set -l normal (set_color normal) + set -q fish_color_status + or set -g fish_color_status red + + set -l bold_flag --bold + set -q __fish_prompt_status_generation; or set -g __fish_prompt_status_generation $status_generation + if test $__fish_prompt_status_generation = $status_generation + set bold_flag + end + set __fish_prompt_status_generation $status_generation + set -l status_color (set_color $fish_color_status) + set -l statusb_color (set_color $bold_flag $fish_color_status) + set -l prompt_status (__fish_print_pipestatus " [" "]" "|" "$status_color" "$statusb_color" $last_pipestatus) + + echo (set_color cyan)(date +%H:%M:%S) (set_color red)(prompt_hostname) (set_color blue)(prompt_pwd)(set_color normal) + + set -l active_jobs (jobs | wc -l) + echo "$active_jobs$prompt_status -> " +end