I use screen, but whatever I have read till now on comparison seems to point more to personal preferences.
I use screen, but whatever I have read till now on comparison seems to point more to personal preferences.
For me, it's because it's more common to use tmux and you can find from legacy configs to modern ones. So, for me, that I have not studied IT (and now I work as a programmer) it's essential to find basic configurations all over the place to have an anchor.
But, as always... Use whichever works for you. Don't think in the "best" or the "most efficient" which is just youtube propaganda. Use whichever works for you and makes you feel like home. If that's 98's microsoft word... then embrace it and be proud to have an opinion.
1. if I start something which will run for a long time and/or the connection is unstable, I start a screen session on the remote node and start the program in it
2. if I want to check something (i.e. tail -f foo.log) on several servers at the same time, I start tmux on my machine, create 2,3,...,N panes and in each pane I ssh to the 1-1 remote server and start tail -f foo.log there. So I'll see the logs at the same time on several servers, just like if I had 1-1 monitor for each remote server.
I find screen to be more stable than tmux but can't say I had any issues with tmux in the past couple of years (but it bothers me that tmux sessions share the initial environment the first session was launched from iirc). Right now it's the clipboard support that makes me use tmux over screen.
It does do this, but I am curious what would be better? I heard this complaint before and It baffles me. let me explain.
environments are... sticky, a child process inherits it's parent processes environment. so the tmux server starts and inherits the environment from the shell that started it, then each pane inherits the environment from the tmux server. As far as I can tell you want each pane to inherit the environment from somewhere else but can't figure out why or how that would happen.
My best guess is that you want tmux-attach to stash the environment it was ran in so that tmux could then use that when making new panes. my second guess is that you want tmux to use the current pane as the parent process for a new pane. both of which sounds like it would be even harder to control the tmux environment.
In fact I was a bit surprised that .profile ran on every created pane, as naively I would not have thought that would be a login shell.
not sure about the rest, I did read the man page again, and wow there is a lot more configurabilty than I first thought, however I found nothing great, the best I could come up with is.
bind c 'source-file /home/xxx/.tmux.conf; new-window'