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_shellrc+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 ## Set the temporary directory again. (If we've switched users, we'll want a
26 ## different temporary directory.)
27 case ${TMPDIR+t} in t) ;; *) eval $(tmpdir -b); esac
29 ###--------------------------------------------------------------------------
32 __mdw_set_prompt_hacks () {
34 linux*|screen*|xterm*|vt100*|eterm*)
35 case "$(tput bold)" in
36 "") bold="\[$(tput md)\]" unbold="\[$(tput me)\]" ;;
37 *) bold="\[$(tput bold)\]" unbold="\[$(tput sgr0)\]" ;;
39 gitcolour="\[$(tput setaf 6)\]"
40 rccolour="\[$(tput setaf 1)\]"
41 uncolour="\[$(tput op)\]"
48 __mdw_before_cmd_hack () {
49 set -- $(history 1); shift
53 ## Only bother if the shell is interactive.
56 __mdw_source_if_exists /usr/lib/git-core/git-sh-prompt
57 __mdw_set_prompt_pieces
58 PROMPT_COMMAND=__mdw_precmd
59 PS0="\$(__mdw_before_cmd_hack)"
62 ###--------------------------------------------------------------------------
63 ### Other shell tweaking.
65 ## Random shell tweaks.
74 shopt -s expand_aliases
76 if (( ${BASH_VERSINFO[0]} >= 4 )); then shopt -s globstar; fi
83 shopt -s interactive_comments
89 shopt -u shift_verbose
91 HISTCONTROL=ignorespace:erasedups
93 ###--------------------------------------------------------------------------
94 ### Finishing touches.
96 ## Run any local hooks.
97 __mdw_source_if_exists "$HOME/.bashrc-local"
99 ###----- That's all, folks --------------------------------------------------