configs  Artifact [6f18624903]

Artifact 6f18624903e995758650af3bff9571c2a1993056ee621e637df1f361ffc4caa1:

  • File fish/functions/fish_prompt.fish — part of check-in [46ef6bc803] at 2020-05-25 20:32:31 on branch trunk — fish_prompt: Redirect fossil's stderr to /dev/null (user: js size: 882)

function fish_prompt --description 'Write out the prompt'
    set -l suffix
    switch "$USER"
        case root toor
            set suffix (set_color $fish_color_cwd_root)'#'
        case '*'
            set suffix '>'
    end

    set -l branch (git symbolic-ref HEAD 2>/dev/null)
    set branch (string replace -r "^refs/heads/" "" $branch)
    
    if test -z "$branch"
        set branch (fossil branch current 2>/dev/null)
    end

    set -l vcs
    if test -n "$branch"
        set vcs (set_color $fish_color_vcs_braces)"(" \
                (set_color $fish_color_vcs)"$branch" \
                (set_color $fish_color_vcs_braces)")"
    end

    echo -n -s (set_color $fish_color_host) (prompt_hostname) ' ' \
               (set_color $fish_color_cwd) (prompt_pwd) (string join '' $vcs) \
               (set_color $fish_color_suffix) $suffix (set_color normal) ' '
end