Hacker News new | ask | show | jobs
by jrochkind1 3677 days ago
I don't get it, isn't your bash history already logged to `.bash_history`? What's the point of using PROMPT_COMMAND to send it in addition to another file?
1 comments

Excellent question! Multiple tabs will squash each other, losing history from Tab B between when tab A was opened and when tab A was closed.

It's actually an insecure default - 'insecure' as in, it's a minor form of data loss.

Then again, so is bash launching scripts without pipefail, variable expansion fail, etc.

It'd be worth fixing all this stuff in the next major bash version.

If you can use it, zsh does not have that issue. Plus a bunch of other goodies. It's been a while since I've last used bash.
cf.

  histappend