An example is when the machine is rebooted in the middle of a long-running command. I don't know that it's terribly often, but it has happened to me enough that I'd like to make sure it doesn't happen again.
On Tue, Nov 17, 2026 at 7:29 AM Chet Ramey <[email protected]> wrote: > On 11/12/26 11:00 PM, Luke Schlather wrote: > > In reply to: https://lists.gnu.org/r/bug-bash/2024-08/msg00163.html > > > > I've always been annoyed by disappearing history. From reading some > threads > > and a bit of exploration, I think the simplest thing is to add an > > inc_append_history shopt which is named like the equivalent zsh option. > > What this does is after a command is parsed, but before it is executed, > it > > is appended to the history file. This basically gives the behavior of > > PROMPT_COMMAND='history -a' but also ensures the history file is updated > if > > the shell crashes before the command completes. > > Is this a problem requiring an additional option? How often does the shell > crash before writing a command to the history file? > > -- > ``The lyf so short, the craft so long to lerne.'' - Chaucer > ``Ars longa, vita brevis'' - Hippocrates > Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/ >
