Skip to content

Commit f264225

Browse files
committed
Adding the git-branch name into the prompt.
1 parent 09c8670 commit f264225

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scripts/enter-env.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,14 @@ hdmi2usb_prompt() {
165165
P="$P P=$PROG"
166166
fi
167167

168+
BRANCH="$(git symbolic-ref --short HEAD 2> /dev/null)"
169+
if [ "$BRANCH" != "master" ]; then
170+
if [ x"$BRANCH" = x ]; then
171+
BRANCH="???"
172+
fi
173+
P="$P R=$BRANCH"
174+
fi
175+
168176
PS1="$P) $ORIG_PS1"
169177
}
170178
PROMPT_COMMAND=hdmi2usb_prompt

0 commit comments

Comments
 (0)