shell prompt should not beep and only show MSYSTEM when non-standard.
authorPat Thoyts <patthoyts@users.sourceforge.net>
Tue, 4 Dec 2012 22:55:17 +0000 (4 22:55 +0000)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Tue, 4 Dec 2012 22:55:17 +0000 (4 22:55 +0000)
The last change also printed the current working directory twice - once
after the MSYSTEM and once after user@host. Reduced to a single instance.

Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
etc/profile

index 5926388..6606310 100644 (file)
@@ -154,19 +154,20 @@ esac
 
 # non-printable characters must be enclosed inside \[ and \]
 PS1='\[\033[0m\]'              # VT100 compat: reset all colors
-PS1="$PS1"'$MSYSTEM:\w'        # e.g. MINGW32:/path/to/cwd
-PS1="$PS1"'\[\007\]'           # Ascii character BEL
-PS1="$PS1"'\n'                 # new line
 PS1="$PS1"'\[\033[32m\]'       # change color
 PS1="$PS1"'\u@\h '             # user@host<space>
 PS1="$PS1"'\[\033[33m\]'       # change color
 PS1="$PS1"'\w'                 # current working directory
 if test -z "$WINELOADERNOEXEC"
 then
-       PS1="$PS1"'$(__git_ps1)'   # bash function
+    PS1="$PS1"'$(__git_ps1)'   # bash function
 fi
 PS1="$PS1"'\[\033[0m\]'        # change color
 PS1="$PS1"'\n'                 # new line
+                               # show MSYSTEM if non-standard
+if [ "$MSYSTEM" != "MINGW32" ]; then
+    PS1="$PS1"'\[\033[35m\]($MSYSTEM)\[\033[0m\] '
+fi
 PS1="$PS1"'$ '                 # prompt: always $
 
 # set default options for 'less'