News for hackers. Stuff that matters.
Re:So you've installed `fzf`. Now what? by dtgriscom on Tuesday March 21, 2023 @08:53PM (#35255163)
I often have three or more terminals open, doing different tasks in each; I also often have cycles of work where I'll repeat the last three commands again (three up-arrows and a return). This breaks if one terminal's commands get inserted into another terminal's history.
Re:So you've installed `fzf`. Now what? by aidenn0 on Tuesday March 21, 2023 @11:49PM (#35256587)
My solution is I immediately record the commands, but do not load them. That way new terminals get all the history, but old terminals keep their flow.
Re:So you've installed `fzf`. Now what? by geysersam on Wednesday March 22, 2023 @05:26AM (#35258666)
But if you go back later, the chains of commands from different terminals are interlaced right?
Re:So you've installed `fzf`. Now what? by aidenn0 on Wednesday March 22, 2023 @11:25AM (#35262484)
To some degree; it depends on the amount of multitasking. I mainly care about which commands in which order when I'm looking at recent commands from that terminal; otherwise I use C-r.
Re:So you've installed `fzf`. Now what? by flyaway123 on Wednesday March 22, 2023 @01:05AM (#35257047)
Comment from the author:

"Ted, the change I suggest doesn't affect the independence of your sessions as you suggest. Each shell maintains a unique history in memory so modifying the history file has no affect on running terminals. The only time the history file is read is when you start a new terminal. I recommend you try my suggestion. Really, all I am doing is eliminating the race condition that causes the bash history file to have inconsistent data.

Thanks for the feedback."

Re:So you've installed `fzf`. Now what? by cstrahan on Wednesday March 22, 2023 @04:10AM (#35258161)
Exactly this.

If you do want to load the history persisted from other shells into the current one, all you have to do (if memory serves) is:

    $ history -r