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 ## Fetch the common configuration.
16 ## If we've not run the main profile yet, we should do that first. It sets
17 ## up things we rely on. Also, if there's a system script, we should run
19 case ${__mdw_profile+t} in t) ;; *) . "$HOME/.profile" ;; esac
20 __mdw_source_if_exists /etc/bashrc
23 __mdw_source_if_exists /etc/bash_completion "$HOME/.bash_completion"
25 ###--------------------------------------------------------------------------
28 __mdw_set_prompt_hacks () {
30 linux*|screen*|xterm*|putty*|vt100*|eterm*)
31 case "$(tput bold)" in
32 "") bold="\[$(tput md)\]" unbold="\[$(tput me)\]" ;;
33 *) bold="\[$(tput bold)\]" unbold="\[$(tput sgr0)\]" ;;
35 gitcolour="\[$(tput setaf 6)\]"
36 rccolour="\[$(tput setaf 1)\]"
37 uncolour="\[$(tput op)\]"
44 __mdw_before_cmd_hack () {
45 set -- $(history 1); shift
49 ## Only bother if the shell is interactive.
52 __mdw_source_if_exists /usr/lib/git-core/git-sh-prompt
53 __mdw_set_prompt_pieces
54 PROMPT_COMMAND=__mdw_precmd
55 PS0="\$(__mdw_before_cmd_hack)"
58 ###--------------------------------------------------------------------------
59 ### Other shell tweaking.
61 ## Random shell tweaks.
70 shopt -s expand_aliases
72 if (( ${BASH_VERSINFO[0]} >= 4 )); then shopt -s globstar; fi
80 shopt -s interactive_comments
86 shopt -u shift_verbose
88 HISTCONTROL=ignorespace:erasedups
90 ###--------------------------------------------------------------------------
91 ### Finishing touches.
93 ## Run any local hooks.
94 __mdw_source_if_exists "$HOME/.bashrc-local"
96 ###----- That's all, folks --------------------------------------------------