dotfiles/config/fish/functions/fish_prompt.fish (view raw)
| 1 | function fish_prompt |
| 2 | set -l last_status $status |
| 3 | set -l cwd (prompt_pwd --full-length-dirs 1) |
| 4 | set -l vcs (prompt_vcs) |
| 5 | |
| 6 | set -l session '' |
| 7 | if set -q ZMX_SESSION |
| 8 | set session (set_color --dim blue)"($ZMX_SESSION) "(set_color normal) |
| 9 | end |
| 10 | |
| 11 | switch $fish_bind_mode |
| 12 | case default |
| 13 | set mode_char "❮" |
| 14 | set mode_color (set_color cyan) |
| 15 | case '*' |
| 16 | set mode_char "❯" |
| 17 | if test $last_status -eq 0 |
| 18 | set mode_color (set_color green) |
| 19 | else |
| 20 | set mode_color (set_color red) |
| 21 | end |
| 22 | end |
| 23 | |
| 24 | printf '%s%s%s%s%s%s%s%s ' $session (set_color cyan) $cwd (set_color normal) $vcs $mode_color $mode_char (set_color normal) |
| 25 | end |