summaryrefslogtreecommitdiffstats
path: root/.config/fish/functions/fish_prompt.fish
blob: daaadbc5e4ede3210201d9307646ad1208b9aed9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function fish_prompt
    set -l __last_command_exit_status $status

    set -l cyan (set_color -o cyan)
    set -l red (set_color -o red)
    set -l green (set_color -o green)
    set -l normal (set_color normal)

    set -l marker_color "$green"
    if test $__last_command_exit_status != 0
        set marker_color "$red"
    end

    set -l marker "$marker_color" "δ"
    if fish_is_root_user
        set marker "$marker_color# "
    end

    set -l cwd $cyan (string join / (string split -rn -m3 / (prompt_pwd))[-3..-1])

    echo -n -s $marker ' ' $cwd $normal ' '
end