Re:Ask HN: Which is better tmux or screen?
by atmosx on Saturday April 15, 2017 @04:49AM
(#14119978)
What I've always missed going from screen to tmux is the ability to keep logs. "screen -L" will do the trick, while in tmux I need to install a plugin.
Re:Ask HN: Which is better tmux or screen?
by archmonk on Friday April 14, 2017 @03:49PM
(#14116732)
Interesting I didn't know that in screen you could isolate bash history per context.
Re:Ask HN: Which is better tmux or screen?
by dllthomas on Friday April 14, 2017 @05:08PM
(#14117390)
It's not screen doing the work.
Screen is just a process that spawns other processes, and like always those inherit environment variables. The script I have that starts screen defines a variable called "SESSION" beforehand, and that's used in my bashrc to set HISTFILE (and other things). Screen is just how I organize it.
I use it, plus some scripts, to keep my work separated into various contexts. See https://github.com/dlthomas/config-files/blob/master/bin/ses... and https://github.com/dlthomas/config-files/blob/master/.bash.d...
The single biggest win is keeping a separate bash history per context. But it's also very handy to define context specific functions and aliases, cd at start to a relevant directory, etc.
Putting it all inside screen means that I can trivially start a new shell in the same context and gives a nice grouping.