# HG changeset patch # User Steve Huston # Date 1471538116 14400 # Node ID 90f60047d5b47b70014e202d2c9344de652b2bce # Parent ef534933ab0455a88c6c7c7471ded8296ce9ab6e Set a bunch of history-friendly options diff -r ef534933ab04 -r 90f60047d5b4 .bash_profile --- a/.bash_profile Tue Jul 05 12:31:53 2016 -0400 +++ b/.bash_profile Thu Aug 18 12:35:16 2016 -0400 @@ -67,6 +67,24 @@ fi hg status +# Set some friendly options for history +# Append to ~/.bash_history, don't overwrite it +shopt -s histappend +# Set the history a bit larger, both on disk and in memory +export HISTFILESIZE=10000 +export HISTSIZE=10000 +# Ignore lines starting with a space, and duplicates of the previous command; +# also, if a line is a dupe from earlier history, remove the previous line +# entirely +export HISTCONTROL='ignoreboth:erasedups' +# Ignore some commonly used and not noteworthy commands +export HISTIGNORE='bg:fg:history:ret:keys' +# Put a timestamp on history lines +export HISTTIMEFORMAT='%F %T ' +# Fold multi-line commands into a single line +# This seems to be 'on' in many places already, but let's make sure +shopt -s cmdhist + [[ $HOST == cake && "`tty`" == "/dev/tty1" ]] && { # We're on the Raspberry Pi export SDL_NOMOUSE=1 diff -r ef534933ab04 -r 90f60047d5b4 .bashrc --- a/.bashrc Tue Jul 05 12:31:53 2016 -0400 +++ b/.bashrc Thu Aug 18 12:35:16 2016 -0400 @@ -40,11 +40,11 @@ # If this is an xterm set the title to user@host:dir case $TERM in xterm*|rxvt*) - PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"' + PROMPT_COMMAND='history -a ; echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"' ;; screen*) # But if it's a screen window, leave it alone please - PROMPT_COMMAND="" + PROMPT_COMMAND="history -a" ;; *) ;;