summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-shells/bash/files/bashrc')
-rw-r--r--app-shells/bash/files/bashrc27
1 files changed, 20 insertions, 7 deletions
diff --git a/app-shells/bash/files/bashrc b/app-shells/bash/files/bashrc
index 300070974f54..6622b84eb71d 100644
--- a/app-shells/bash/files/bashrc
+++ b/app-shells/bash/files/bashrc
@@ -20,16 +20,29 @@ fi
# http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11)
shopt -s checkwinsize
-# Enable history appending instead of overwriting. #139609
+# Disable completion when the input buffer is empty. i.e. Hitting tab
+# and waiting a long time for bash to expand all of $PATH.
+shopt -s no_empty_cmd_completion
+
+# Enable history appending instead of overwriting when exiting. #139609
shopt -s histappend
+# Save each command to the history file as it's executed. #517342
+# This does mean sessions get interleaved when reading later on, but this
+# way the history is always up to date. History is not synced across live
+# sessions though; that is what `history -n` does.
+PROMPT_COMMAND='history -a'
+
# Change the window title of X terminals
case ${TERM} in
xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|interix|konsole*)
- PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
+ PS1='\[\033]0;\u@\h:\w\007\]'
;;
screen*)
- PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\033\\"'
+ PS1='\[\033k\u@\h:\w\033\\\]'
+ ;;
+ *)
+ unset PS1
;;
esac
@@ -65,9 +78,9 @@ if ${use_color} ; then
fi
if [[ ${EUID} == 0 ]] ; then
- PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
+ PS1+='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
else
- PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
+ PS1+='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
fi
#BSD#@export CLICOLOR=1
@@ -78,9 +91,9 @@ if ${use_color} ; then
else
if [[ ${EUID} == 0 ]] ; then
# show root@ when we don't have colors
- PS1='\u@\h \W \$ '
+ PS1+='\u@\h \W \$ '
else
- PS1='\u@\h \w \$ '
+ PS1+='\u@\h \w \$ '
fi
fi