Created
October 2, 2019 07:52
-
-
Save adrianlungu/67a5e349e16252e0b9cbe89aced51c84 to your computer and use it in GitHub Desktop.
Bash History per iTerm Tab/Session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Unique history file per shell session. | |
export HISTSIZE=1000 | |
export HISTFILE=~/.bash-history-${ITERM_SESSION_ID} | |
# export HISTFILE=$HOME/.bash_hist_${HOSTNAME/.*/}_$(basename $(tty)) | |
export SAVEHIST=1000 | |
# New - remove if not working properly | |
export HISTCONTROL=ignoreboth | |
# export HISTCONTROL=ignoredups | |
# For iTerm2 to show the directory it's in | |
if [ $ITERM_SESSION_ID ]; then | |
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND"; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment