Skip to content

Commit

Permalink
filesystem: New specific variable MSYS2_PS1.
Browse files Browse the repository at this point in the history
Setting this variable now makes /etc/bash.bashrc use that as PS1 instead
of default value. This allows for configuration shared between MSYS2 and
other environments like Cygwin or MinGW.org MSYS to define a PS1 that is
specific to MSYS2 without manual detection of the system type.
  • Loading branch information
renatosilva committed May 24, 2016
1 parent f102f8c commit 6e6310d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion filesystem/PKGBUILD
Expand Up @@ -43,7 +43,7 @@ source=('bash.bash_logout'
'08-xml-catalog.post'
'cygwin.ldif')
sha256sums=('6d651f6b0b2d173961a3fa21acd9d44c783ed9cd73a031687698c8b9ed1f6dee'
'b246aec17f8117b18231a94ca8b806b5e281844de402e923a9982f3622f33a43'
'437d8e49e10aa8a5dc29bda296e21d5f8a4920d4bd193d05d58c6aab259a518e'
'99eae6e37081edd73b399009c85f4a67a0c14481241ee4937ab45c4178b540fb'
'ed08a8bd0919ba29ec5dd2d0c74ba74324ca2bcbf7852354b0b6c523809029a0'
'4330edf340394d0dae50afb04ac2a621f106fe67fb634ec81c4bfb98be2a1eb5'
Expand Down
8 changes: 6 additions & 2 deletions filesystem/bash.bashrc
Expand Up @@ -15,8 +15,12 @@
# If not running interactively, don't do anything
[[ "$-" != *i* ]] && return

# Set a default prompt of: user@host, MSYSTEM variable, and current_directory
PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[35m\]$MSYSTEM\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n\$ '
# If MSYS2_PS1 is set, use that as default PS1, otherwise set a default prompt
# of user@host, MSYSTEM variable, and current_directory
if test -n "${MSYS2_PS1}"
then PS1="${MSYS2_PS1}"
else PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[35m\]$MSYSTEM\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n\$ '
fi

# Uncomment to use the terminal colours set in DIR_COLORS
# eval "$(dircolors -b /etc/DIR_COLORS)"

0 comments on commit 6e6310d

Please sign in to comment.