3 ### Bash session things.
7 ## Only do this if we haven't done it before. (Note that this guard isn't
8 ## exported, so subshells will need to make their own arrangements.)
9 case ${__mdw_bashrc+t} in
13 ###--------------------------------------------------------------------------
14 ### Common shell configuration.
18 ###--------------------------------------------------------------------------
19 ### Other preliminaries.
21 ## If we've not run the main profile yet, we should do that first. It sets
22 ## up things we rely on. Also, if there's a system script, we should run
24 case ${__mdw_profile+t} in t) ;; *) . "$HOME/.profile" ;; esac
25 __mdw_source_if_exists /etc/bashrc
28 __mdw_source_if_exists /etc/bash_completion "$HOME/.bash_completion"
30 ###--------------------------------------------------------------------------
33 __mdw_set_prompt_hacks () {
35 linux*|screen*|xterm*|putty*|vt100*|eterm*)
36 case "$(tput bold)" in
37 "") bold="\[$(tput md)\]" unbold="\[$(tput me)\]" ;;
38 *) bold="\[$(tput bold)\]" unbold="\[$(tput sgr0)\]" ;;
40 gitcolour="\[$(tput setaf 6)\]"
41 rccolour="\[$(tput setaf 1)\]"
42 uncolour="\[$(tput op)\]"
49 __mdw_before_cmd_hack () {
50 set -- $(history 1); shift
54 ## Only bother if the shell is interactive.
57 __mdw_source_if_exists /usr/lib/git-core/git-sh-prompt
58 __mdw_set_prompt_pieces
59 PROMPT_COMMAND=__mdw_precmd
60 PS0="\$(__mdw_before_cmd_hack)"
63 ###--------------------------------------------------------------------------
64 ### Other shell tweaking.
66 ## Random shell tweaks.
75 shopt -s expand_aliases
77 if (( ${BASH_VERSINFO[0]} >= 4 )); then shopt -s globstar; fi
85 shopt -s interactive_comments
91 shopt -u shift_verbose
93 HISTCONTROL=ignorespace:erasedups
95 ###--------------------------------------------------------------------------
96 ### Finishing touches.
98 ## Run any local hooks.
99 __mdw_source_if_exists "$HOME/.bashrc-local"
101 ###----- That's all, folks --------------------------------------------------