mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-11-10 02:39:40 +00:00
Fix additional space without git repo
This commit is contained in:
parent
72d294dedb
commit
2e37f399df
|
@ -11,7 +11,7 @@ RESET="%f"
|
||||||
|
|
||||||
git_prompt() {
|
git_prompt() {
|
||||||
ref=$(command git symbolic-ref HEAD 2> /dev/null) || ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0
|
ref=$(command git symbolic-ref HEAD 2> /dev/null) || ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0
|
||||||
echo -n "$ORANGE${ref#refs/heads/}"
|
echo -n " $ORANGE${ref#refs/heads/}"
|
||||||
|
|
||||||
if [ ! -z "$(git status --short)" ]; then
|
if [ ! -z "$(git status --short)" ]; then
|
||||||
echo "$RED+"
|
echo "$RED+"
|
||||||
|
@ -23,7 +23,7 @@ setopt PROMPT_SUBST
|
||||||
# Primary Prompt
|
# Primary Prompt
|
||||||
[ "$EUID" -eq 0 ] && PS1="$RED%n@%m$RESET" || PS1="$GRAY%n@%m$RESET" # user@machine
|
[ "$EUID" -eq 0 ] && PS1="$RED%n@%m$RESET" || PS1="$GRAY%n@%m$RESET" # user@machine
|
||||||
PS1+=" $BLUE%~" # Working directory
|
PS1+=" $BLUE%~" # Working directory
|
||||||
PS1+=" \$(git_prompt)"
|
PS1+="\$(git_prompt)"
|
||||||
PS1+=" $PURPLE%(!.#.»)$RESET " # Final symbol (# or »)
|
PS1+=" $PURPLE%(!.#.»)$RESET " # Final symbol (# or »)
|
||||||
|
|
||||||
# Next line prompt
|
# Next line prompt
|
||||||
|
|
Loading…
Reference in a new issue