Skip to content

Commit

Permalink
Adding the git-branch name into the prompt.
Browse files Browse the repository at this point in the history
  • Loading branch information
mithro committed Jun 7, 2016
1 parent 51180ba commit 3fbac53
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/enter-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ hdmi2usb_prompt() {
P="$P P=$PROG"
fi

BRANCH="$(git symbolic-ref --short HEAD 2> /dev/null)"
if [ "$BRANCH" != "master" ]; then
if [ x"$BRANCH" = x ]; then
BRANCH="???"
fi
P="$P R=$BRANCH"
fi

PS1="$P) $ORIG_PS1"
}
PROMPT_COMMAND=hdmi2usb_prompt

0 comments on commit 3fbac53

Please sign in to comment.