Last active
October 21, 2020 01:55
-
-
Save pudquick/c241cb84f28250a77232 to your computer and use it in GitHub Desktop.
Unified history in bash (with a focus on OS X)
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
# You need to add these two lines to your bash environment | |
shopt -s histappend | |
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r" | |
# In most *nix variants, that means adding them to your .bashrc file. | |
# However, on OS X, the default session for Terminal is a login session, | |
# meaning that it doesn't run .bashrc. | |
# As such, you'll need to include these commands into your | |
# .profile or .bash_profile (whichever you have/want). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment