dotfiles/config/fish/functions/fish_prompt.fish (view raw)
Oleksandr Smirnov
Oleksandr Smirnov
olexsmir@gmail.com add zmx session name to fish prompt; update kitty config, 1 month ago
olexsmir@gmail.com add zmx session name to fish prompt; update kitty config, 1 month ago
| 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 close_color normal |
| 7 | test $last_status -ne 0; and set close_color red |
| 8 | |
| 9 | set -l zmx_segment '' |
| 10 | test -n "$ZMX_SESSION"; and set zmx_segment (set_color --dim blue)"$ZMX_SESSION "(set_color normal) |
| 11 | |
| 12 | set -l vcs_segment '' |
| 13 | test -n "$vcs"; and set vcs_segment (printf ' (%s%s%s%s)' (set_color blue) $vcs (set_color $close_color) '') |
| 14 | printf '%s%s%s%s%s ' $zmx_segment (set_color cyan) $cwd (set_color normal) $vcs_segment(set_color normal) |
| 15 | end |