From 0fca0e36b13ecca1a9acfc9edc99bb9999740dac Mon Sep 17 00:00:00 2001 From: Mitsuo Tokumori Date: Fri, 21 Jan 2022 01:26:15 -0500 Subject: Keep git-bash's prompt when available --- bashrc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/bashrc b/bashrc index ba7ca01..a546c35 100644 --- a/bashrc +++ b/bashrc @@ -56,15 +56,18 @@ if [ -n "$force_color_prompt" ]; then fi fi -if [ "$color_prompt" = yes ]; then +# Keep the git-bash prompt if available (check if $TITLEPREFIX is set) +# git-bash promp is helpful when browsing a git-repository +#PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$' +if [[ "$color_prompt" = yes && ! -v $TITLEPREFIX ]]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\hh\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' # Blue timestamp and italic green pwd PS1='\[\033[34m\]|\D{%H:%M:%S}| \[\033[3;32m\][\w]\[\033[00m\]\n\$ ' -else - # plain and simple - PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +#else +# # plain and simple +# PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' fi -unset color_prompt force_color_prompt +#unset color_prompt force_color_prompt # If this is an xterm set the title to user@host:dir case "$TERM" in @@ -118,7 +121,7 @@ fi # Custom prompt: # Blue timestamp and italic green pwd -PS1='\[\033[34m\]|\D{%H:%M:%S}| \[\033[3;32m\][\w]\[\033[00m\]\n\$ ' +#PS1='\[\033[34m\]|\D{%H:%M:%S}| \[\033[3;32m\][\w]\[\033[00m\]\n\$ ' # Environmental variables: # less(1) config (ignore case in searchs and display raw control characters) -- cgit v1.2.3