summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitsuo Tokumori <[email protected]>2022-01-21 01:26:15 -0500
committerMitsuo Tokumori <[email protected]>2022-01-21 01:26:15 -0500
commit0fca0e36b13ecca1a9acfc9edc99bb9999740dac (patch)
treeeaba92987d254b20518ed0cc124799a48dee8819
parentb9749714e0a1dcaffb9ed94df4afdcebbcddc9ea (diff)
downloaddotfiles-0fca0e36b13ecca1a9acfc9edc99bb9999740dac.tar.gz
dotfiles-0fca0e36b13ecca1a9acfc9edc99bb9999740dac.tar.bz2
dotfiles-0fca0e36b13ecca1a9acfc9edc99bb9999740dac.zip
Keep git-bash's prompt when available
-rw-r--r--bashrc15
1 files 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)