|
|
|
|
|
by dllthomas
3852 days ago
|
|
https://news.ycombinator.com/item?id=10695029 is the comment, but it didn't contain much detail. Splitting history is done fundamentally by setting HISTFILE - nothing too surprising about that. But for my particular setup, I more broadly divide my shell use by context. I have a script called "session". `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 ~/.session/$SESSION/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. I've found most of this quite nice, but the history is the biggest win. |
|