Mercurial > dotfiles
comparison 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 |
comparison
equal
deleted
inserted
replaced
1037:38b8060cdf24 | 1038:6ab26ddbf78d |
---|---|
1 set fish_prompt_pwd_dir_length 2 | |
2 set -g fish_prompt_pwd_full_dirs 5 | |
3 function fish_prompt | |
4 set -l last_pipestatus $pipestatus | |
5 set -lx __fish_last_status $status # Export for __fish_print_pipestatus. | |
6 set -l normal (set_color normal) | |
7 set -q fish_color_status | |
8 or set -g fish_color_status red | |
9 | |
10 set -l bold_flag --bold | |
11 set -q __fish_prompt_status_generation; or set -g __fish_prompt_status_generation $status_generation | |
12 if test $__fish_prompt_status_generation = $status_generation | |
13 set bold_flag | |
14 end | |
15 set __fish_prompt_status_generation $status_generation | |
16 set -l status_color (set_color $fish_color_status) | |
17 set -l statusb_color (set_color $bold_flag $fish_color_status) | |
18 set -l prompt_status (__fish_print_pipestatus " [" "]" "|" "$status_color" "$statusb_color" $last_pipestatus) | |
19 | |
20 echo (set_color cyan)(date +%H:%M:%S) (set_color red)(prompt_hostname) (set_color blue)(prompt_pwd)(set_color normal) | |
21 | |
22 set -l active_jobs (jobs | wc -l) | |
23 echo "$active_jobs$prompt_status -> " | |
24 end |