summaryrefslogtreecommitdiffstats
path: root/.config/fish/functions/fish_prompt.fish
blob: 06b4309d91c38564d3b9e2abce2dea664efcf032 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function fish_prompt --description 'Write out the prompt'
    set -l color_cwd (set_color $fish_color_cwd)
    set -l color_host (set_color $fish_color_host_remote)
    set -l reset (set_color normal)

    set -l hostinfo ''
    set -l suffix '$'

    # If we're running via SSH, display the hostname and change color.
    if set -q SSH_TTY
        set hostinfo $color_host $USER @ (prompt_hostname) $reset " "
    end

    # prompt
    echo -n -s $hostinfo $color_cwd (prompt_pwd) $reset (git-sonar -f) $reset " " $suffix " "
end