From b6b3c48cf16e0e80a3d9250c486ed5b2f0db1803 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Sun, 29 Jan 2023 21:58:00 +0330 Subject: [PATCH 1/2] remove annoying space when MSYSTEM not set Signed-off-by: David Refoua --- git-extra/git-prompt.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/git-extra/git-prompt.sh b/git-extra/git-prompt.sh index c8a5fa8dee..f7b432d80a 100755 --- a/git-extra/git-prompt.sh +++ b/git-extra/git-prompt.sh @@ -15,6 +15,10 @@ else PS1="$PS1"'\u@\h ' # user@host PS1="$PS1"'\[\033[35m\]' # change to purple PS1="$PS1"'$MSYSTEM ' # show MSYSTEM + if [ ! -z "$MSYSTEM" ] + then + PS1="$PS1"'$MSYSTEM ' # show MSYSTEM + fi PS1="$PS1"'\[\033[33m\]' # change to brownish yellow PS1="$PS1"'\w' # current working directory if test -z "$WINELOADERNOEXEC" From e011309aeb8cfc7a4f7e4b58c0e453a8a9a3c4c7 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Mon, 30 Jan 2023 11:29:26 +0330 Subject: [PATCH 2/2] remove duplicated line, move change color line into if statement Signed-off-by: David Refoua --- git-extra/git-prompt.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/git-extra/git-prompt.sh b/git-extra/git-prompt.sh index f7b432d80a..8541b0e4eb 100755 --- a/git-extra/git-prompt.sh +++ b/git-extra/git-prompt.sh @@ -13,11 +13,10 @@ else PS1="$PS1"'\n' # new line PS1="$PS1"'\[\033[32m\]' # change to green PS1="$PS1"'\u@\h ' # user@host - PS1="$PS1"'\[\033[35m\]' # change to purple - PS1="$PS1"'$MSYSTEM ' # show MSYSTEM if [ ! -z "$MSYSTEM" ] then - PS1="$PS1"'$MSYSTEM ' # show MSYSTEM + PS1="$PS1"'\[\033[35m\]' # change to purple + PS1="$PS1"'$MSYSTEM ' # show MSYSTEM fi PS1="$PS1"'\[\033[33m\]' # change to brownish yellow PS1="$PS1"'\w' # current working directory