4 ms·
Nice PNG, heh. First of all, "clients" are the things that TFA labels "tmux (screen)". Each of "windows" and "panes" are things you can ignore, or not, as you
by jholman 13y ago
Nice PNG, heh.
First of all, "clients" are the things that TFA labels "tmux (screen)". Each of "windows" and "panes" are things you can ignore, or not, as you find them useful. Windows are like browser tabs, panes are screen-splits. I use windows, I don't (yet) use panes. Otoh, many people are in it just for the planes. YMMV. But you cannot use tmux without "clients" and "sessions".
Second of all, `man screen` does discuss the theory and how things interact. So if you have 20 or 30 minutes, you can read the man page and basically Learn All The Things.
----------
Third, you said you're interested in m:n. Maybe my tmux workflow is relevant to you.
I have, let's imagine, a need for 5 terminals. "notes", version-control, make/tests/etc, misc-bash, and vim. I make space on my desktop physical monitor for three terminals (100x60); but only one on my laptop (100x40).
I start by creating one Session that contains five Windows, and each window corresponds to one of the five ptys that I want (notes, vcs, make, bash, vim). But I can only view one of these at a time, right?
TMUXSESS=foo
tmux new -d -n notes -s "$TMUXSESS"1 # new detached session "foo1", with window "notes"
tmux neww -P -n vcs -t "$TMUXSESS"1: # new window "vcs" in existing session "foo1"
tmux neww -P -n make -t "$TMUXSESS"1:
tmux neww -P -n bash -t "$TMUXSESS"1:
tmux neww -P -n vim -t "$TMUXSESS"1:
So now I could connect three (or twenty) clients all to the same session. BUT, this isn't the solution, because they'd all the same view of what I'm doing (which is amusing at first, but useless).
But, hooray, introducing another tmux concept, "groups". "Groups" are groups of sessions, that contain the same windows, but do not have to share a view.
tmux new -d -s "$TMUXSESS"2 -t "$TMUXSESS"1 # new session "foo2" grouped with "foo1"
tmux new -d -s "$TMUXSESS"3 -t "$TMUXSESS"1
Now I open my three gnome-terminals. In the first one I do
tmux a -t "$TMUXSESS"1 # attach to "foo1"
and likewise for the second and third.
And if I feel like working from my laptop, I vpn+ssh to my desktop, and just attach another tmux client to foo1 or foo2 or foo3. This one shares a lock-stepped view with the session it's attached to, but who cares, I'm not watching the desktop. Tmux resizes every session to the minimum-sized attached client, so it's important that I detach my laptop-client when I wanna go back to my desktop. If I forget, no problem, tmux lets me do that from either keyboard (though I have to look up the syntax to do it from my desktop's keyboard).
So, 5 things to look at, 3 or 4 views into those things, arbitrary swapping each to the other. I haven't been using this very long. It's GLORIOUS. Does that help?
- kps 13y agoYes, that sounds very close to my intended workflow, and 'groups' are the thing I was missing to make it work.