[PATCH] [base-files] Don't clobber prompt set in /etc/profile.d

Daniel Santos daniel.santos@pobox.com
Fri Mar 17 17:40:00 GMT 2017

When I build my own machine, I prefer to set my own default prompt in
/etc/profile.d.  This makes it easier on me, but still allows other
users to set whatever prompt they please.  This line in bash.bashrc
incorrectly clobbers whatever prompt is set in /etc/profile.d.

Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
 etc/defaults/etc/bash.bashrc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/etc/defaults/etc/bash.bashrc b/etc/defaults/etc/bash.bashrc
index 0f633fa..7fc78aa 100644
--- a/etc/defaults/etc/bash.bashrc
+++ b/etc/defaults/etc/bash.bashrc
@@ -27,7 +27,7 @@
 export EXECIGNORE="*.dll"
 # Set a default prompt of: user@host and current_directory
-PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
+PS1="${PS1:-'\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '}"
 # Uncomment to use the terminal colours set in DIR_COLORS
 # eval "$(dircolors -b /etc/DIR_COLORS)"

More information about the Cygwin-patches mailing list