Last active
November 21, 2020 18:54
-
-
Save javaJake/cd473be7a019618f4bdd to your computer and use it in GitHub Desktop.
Use the prompt to synchronize history between shells
This file contains hidden or 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
shopt -s histappend | |
HISTTIMEFORMAT="%s " | |
ETERNAL_HISTORY_FILE="$HOME/.bash_eternal_history" | |
PROMPT_COMMAND="history -a; history -n; $PROMPT_COMMAND" | |
PROMPT_COMMAND='echo "$$" "$USER" "$(history 1)" >> "$(eval '"'"'echo $ETERNAL_HISTORY_FILE'"'"')"; '"${PROMPT_COMMAND}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment