Skip to content

Question about history handling #500

Answered by akinomyoga
jkemp814 asked this question in Q&A
Discussion options

You must be logged in to vote

I am still getting duplicates in my .bash_history file.

This is a consequence of history -a called in PROMPT_COMMAND and in theme definitions. The new entry is written to the history file immediately after the command is executed. So, even if the duplicate entries are removed from the in-memory history by erasedups, the entries that are already written to files remain. Since shopt -s histappend is specified, the history file will not be retroactively rewritten on the session end.

To force the erasedups to the history file, you need to turn off the synchronized history; You need to comment out line 27 of lib/history.sh, and also remove history -a;history -c;history -r in each theme file …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jkemp814
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants