# Disable CTRL-s / CTRL-q
stty -ixon
-# hostname:workingdir
-PROMPT_COMMAND='echo -ne "\\033]0;$(hostname|cut -d. -f1):${PWD/$HOME/\~}\\007"'
-
# Use dark background colors in apps like vim
export COLORFGBG='15;0'
return 1
}
-[ -r /usr/lib/git-core/git-sh-prompt ] && source /usr/lib/git-core/git-sh-prompt
-[ -r /usr/share/git/completion/git-prompt.sh ] && source /usr/share/git/completion/git-prompt.sh
+for p in /usr/lib/git-core/git-sh-prompt \
+ /usr/share/git/completion/git-prompt.sh \
+ /usr/local/share/git-core/contrib/completion/git-prompt.sh
+do
+ [ -r "$p" ] && source "$p" && break
+done
+
function my_git_ps1 {
find_up_exists .git || return
GIT_PS1_SHOWDIRTYSTATE=1 \
find_up_exists .svn || return
local status
status="$(svn status --ignore-externals 2> /dev/null | cut -c1 | sort -u | tr -d ' \n')"
- [ -n "$status" ] && echo -n " ($s)"
+ [ -n "$status" ] && echo -n " ($status)"
}
# Two line prompt
# man with coloured headings and a terminal title
function man {
- echo -ne "\\033]0;man $*\\007"
-
env \
LESS_TERMCAP_md=$'\E[01;38;5;74m' \
LESS_TERMCAP_me=$'\E[0m' \
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$@"
}
+
+#########################
+# Optional local config #
+#########################
+
+[ -r ~/.bashrc_local ] && source ~/.bashrc_local
+
+
+##################
+# xterm titlebar #
+##################
+
+# When at a prompt display `hostname:workingdir`
+PROMPT_COMMAND='echo -ne "\\033]0;$(hostname|cut -d. -f1):${PWD/$HOME/\~}\\007"'
+
+# Display the command about to be executed
+# This must go at the end of bashrc to avoid running the trap on commands in the bashrc
+trap 'echo -ne "\\033]0;$BASH_COMMAND\007"' DEBUG
+
+
###########
# The end #
###########
-
-[ -r ~/.bashrc_local ] && source ~/.bashrc_local