Hacker News new | ask | show | jobs
by postepowanieadm 490 days ago
It's quite nice. However a few basic functions are missing, like separate history for each instance.
1 comments

Scenario: Something forces a reboot. I've got 4 bash shells open. I've been doing some compilation & linking of libraries with a crazy long gcc command. After I reboot, that's not in my history because only the first-opened bash shell's history seems to get saved and I've gotta recreate the commandline again. Is there any shell that would let me see all the history from all of the different shells I might have had open?
That's how bash works for me, I believe by the combination of these in my .profile:

  shopt -s histappend
  PROMPT_COMMAND="history -a"
I had something similar set up on my second to last work laptop. I had done some heavy customization that was mostly focused on common workflows for that job, but I have learned that I should still keep a backup even if most of it won't work elsewhere. I should have learned this lesson almost a couple decades ago when I lost all my emacs customizations on a personal computer. But instead, I decided to learn vim.
I really like https://atuin.sh/

It’s a free local (or remote) better shell history utility. Does a good job of syncing histories across multiple windows in my experience

As unhelpful as the other commenter suggesting atuin was, this is actually a thing that atuin does well, if you're using a shell it supports, it commits to history immediately.
I have my zsh set up that way

# History file for zsh HISTFILE=~/.zsh_history

# How many commands to store in history HISTSIZE=10000 SAVEHIST=10000

# Share history in every terminal session

setopt SHARE_HISTORY