diff --git a/fish/functions/fish_prompt.fish b/fish/functions/fish_prompt.fish index ae6335d..ea144b9 100644 --- a/fish/functions/fish_prompt.fish +++ b/fish/functions/fish_prompt.fish @@ -9,8 +9,13 @@ function fish_prompt --description 'Write out the prompt' 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) + end + set -l vcs - if test -n "$branch" -a "$branch" != "master" + if test -n "$branch" set vcs (set_color $fish_color_vcs_braces)"(" \ (set_color $fish_color_vcs)"$branch" \ (set_color $fish_color_vcs_braces)")" diff --git a/zshrc b/zshrc index 16517b8..4d67b26 100644 --- a/zshrc +++ b/zshrc @@ -99,17 +99,11 @@ set_prompt __precmd() { __update_terminal_cwd - local branch="" + local branch=$(git symbolic-ref HEAD 2>/dev/null) + branch=${branch##refs/heads/} - local fossil_branch=$(fossil branch current 2>/dev/null) - if [ -n "$fossil_branch" ]; then - branch="$branch${branch:+ }f:$fossil_branch" - fi - - local git_branch=$(git symbolic-ref HEAD 2>/dev/null) - git_branch=${git_branch##refs/heads/} - if [ -n "$git_branch" ]; then - branch="$branch${branch:+ }g:$git_branch" + if [ -z "$branch" ]; then + branch=$(fossil branch current 2>/dev/null) fi set_prompt $branch