<a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10695029" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10695029</a> is the comment, but it didn&#x27;t contain much detail.<p>Splitting history is done fundamentally by setting HISTFILE - nothing too surprising about that.<p>But for my particular setup, I more broadly divide my shell use by context.  I have a script called &quot;session&quot;.  `session $somename` looks for a screen (feel free to prefer tmux) session named $somename.  If one exists, it attaches it.  If not, it spawns it.  Before doing so, it sets a shell variable SESSION to $somename.  My bash_profile then customizes a lot of things based on the contents of that variable, including adding $SESSION to the prompt, and sourcing ~&#x2F;.session&#x2F;$SESSION&#x2F;bash_profile.  This lets me set context-specific aliases and such.  Because SESSION is set above the terminal multiplexer, new windows spawned while in one context share the same context.<p>I&#x27;ve found most of this quite nice, but the history is the biggest win.