Skip to content

Instantly share code, notes, and snippets.

@brianjlandau
Last active March 11, 2016 19:12
Show Gist options
  • Save brianjlandau/334175780e11ac6ca410 to your computer and use it in GitHub Desktop.
Save brianjlandau/334175780e11ac6ca410 to your computer and use it in GitHub Desktop.
# History control
HISTFILESIZE=100000
export HISTFILESIZE
HISTSIZE=100000
export HISTSIZE
HISTCONTROL=ignoredups:erasedups
export HISTCONTROL
shopt -s histappend
_bash_history_sync() {
builtin history -a
builtin history -c
builtin history -r
}
history() {
_bash_history_sync
builtin history "$@"
}
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}_bash_history_sync;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment