4 ms·
That's a bug? Happens to me with bash all the time, all I have to do is open 2 terminals at the same time... whichever one I close last is the one that writes
by nubinetwork 2mo ago
That's a bug? Happens to me with bash all the time, all I have to do is open 2 terminals at the same time... whichever one I close last is the one that writes its history. /shrug
- valleyer 2mo agoThat's what zsh's INC_APPEND_HISTORY (mentioned in TFA) avoids. Bash may have an equivalent.
- shock 2mo ago> Bash may have an equivalent. # ~/.bashrc shopt -s histappend
- mmh0000 2mo agoThis is exactly why I stopped using Bash around 2012. I was soooo tired of losing random shell history. If you haven't looked into ZSH, it has some really nice customizations. Notably, from my config[1]: # Remove dups setopt HIST_FIND_NO_DUPS setopt HIST_IGNORE_DUPS # Don't log commands starting with a space setopt HIST_IGNORE_SPACE # Replcae bang-command !34 with the actual command in the history setopt BANG_HIST # Remove extraneous spaces setopt HIST_REDUCE_BLANKS # Write the history file in the ":start:elapsed;command" format setopt EXTENDED_HISTORY # Record run-time of the command setopt INC_APPEND_HISTORY_TIME [1] https://doc.xn0.org/.zshrc https://doc.xn0.org/.zshrc
- praash 2mo agoRunning bash inside zsh continuously destroyed my history for the last 3 years until I figured that HISTFILE was exported and inherited by bash.