emacs-tangents
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OT] Not clobbering bash history


From: Arsen Arsenović
Subject: Re: [OT] Not clobbering bash history
Date: Thu, 07 Dec 2023 14:06:38 +0100

Richard Stallman <rms@gnu.org> writes:

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
> I moved this to emacs-tangents because thus isn't really about Emacs,
> but I don't know of a Bash list to use.  Is there one?

IIRC there's bug-bash and it accepts patches, so it is perhaps also
appropriate for topics like this one.

>   > Say that the history has eight entries, and a ninth was added by a
>   > parallel process, the current process would be at the point after the
>   > eighth element and should continue reading from there next time it wants
>   > a history entry.
>
> Are you saying that multiple Bash processes in parallel should share
> one single history, which would contain all the commands the user
> entered in any of these processes?

Yes.  Opinions vary on this, but I have a workflow which relies on this
(via a hack I put in my bashrc and found ages ago).

> So the commands of Basb process A and those of Basb process B would be
> interspersed in the history?  And as you go forward and back in the
> history in Bash process B, you would see A's commands and B's commands
> in chronological order?

Yes.  ZSH does implement this well IME (but I haven't used ZSH
extensively.. so I'm not sure if I'd run into trouble with it).

> That makes a kind of sense, but what I would envision is that each
> Bash process has its own history with only the commands of that process.

Some do prefer that.  It'd be reasonable to do that by default, as it's
currently the default.

> Why do you prefer the shared history file approach
> to the one-history-per-process approach?

Because I rely on working in many, many interactive shells in parallel.

Though, on that note, it is perhaps reasonable to flip 'histappend' to
on by default, even if nothing else changes (because otherwise history
is lost since only the last shells history is kept).

Thanks, have a lovely day.
-- 
Arsen Arsenović

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]