Skip to content

Commit

Permalink
-Fix: don't display // in screen/xterm title if in root dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Juhasz Peter committed Oct 22, 2013
1 parent 4153458 commit 5a0247d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions git-prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1208,8 +1208,10 @@ prompt_command_function() {
fi
previous_rc="$raw_rc"

cwd=${PWD/$HOME/\~} # substitute "~"
set_shell_label "${cwd##[/~]*/}/" # default label - path last dir
local slash='/'
cwd=${PWD/$HOME/\~} # substitute "~"
cwd="${cwd##[/~]*/}/" # default label - path last dir
set_shell_label "${cwd/$slash$slash/$slash}" # remove // if root dir

parse_virtualenv_status
parse_vcs_status
Expand Down Expand Up @@ -1259,7 +1261,6 @@ prompt_command_function() {
# else eval cwd_cmd, cwd should have path after exection
eval "${cwd_cmd/\\/cwd=\\\\}"

local slash='/'
if [[ -w "$PWD" ]]; then
cwd="${cwd//$slash/$slash_color$slash$dir_color}"
else
Expand Down

0 comments on commit 5a0247d

Please sign in to comment.