I'm using tmux
on EC2 AWS but I want to see what is going on in one session I created.
I use Ctrl+b and then d to leave the session.
I'm using tmux
on EC2 AWS but I want to see what is going on in one session I created.
I use Ctrl+b and then d to leave the session.
As far as I know, you can view your
tmux
sessions list by usingtmux list-sessions
to see what sessions are currently running ontmux
.To actually see what is running in those sessions you have to attach to the particular session, to do this you have two options (from experience).
If you are not currently running a
tmux
session (or not currently intmux
session) you attach by runningtmux attach -t n
(where -t stands for target session and n for that session number).If you are running inside another tmux session you'll get an error trying to connect to another session so the simplest way to see what's running there is to use the
tmux list-windows -a
command then move whatever pane/window you have the task running in.Moving a window
Using
tmux move-window -s n1 -t n2
(-s == source window, -t == target window where the source window will attach to. n1 == number of the window you want to move and n2 is number of the window you are moving to).Format
The n1 & n2 numbers are ordered/formatted as
sessionNumb:windowNumb
. So first session in first window will be 0:1, and second session in first window will be 1:1.Note: n2 has to be an available session with a not yet created window. If you move a window to an already created window you will get an error saying "Target window is not empty" and moving to uncreated session will give error "can't find session n".
Moving a pane
Sometimes in one window you might have many panes and you only need to move one pane, this is helpful if you only need that one pane to move inside your current window (as you can't move a window inside another window).
You use almost similar syntax with moving a window but you do
tmux move-pane -s *n1* -t *n2*
.Where n1 now is formatted as
sessionNumb:windowNumb.paneNumb
and so is n2.Examples
After
tmux list-windows -a
you will have something like thisNow, moving the window "Chat" from first session to my second session I'll have to run
tmux move-window -s 0:3 -t 1:4
(remember can't move window to an already created window).Moving a pane
If you only need to move a pane then you need to do
tmux list-panes -a
or if you already know the window it is from, you cantmux list-panes -t 0:1
See format explanations above.Result comes showing session 0 window 1 (-s 0:1) has these panes.
which is just not acceptable, but if you need to see more information so you can know which pane you really need you can do
tmux list-panes -F "#{pane_current_command}" -t 0:1
Which will display current running commands at each pane.
In my case
So after identifying which pane you want (say the vim one) you need to move it.
tmux move-pane -s 0:1.1 -t 1:1.2
to move to a specific pane in this case 2If you have only one pane in the target window you can
tmux move-pane -s 0:1.1 -t 1:1.
no target pane, and it'll still work.Following the answer above, you can try:
tmux ls
to get the session number. And thentmux attach-session -t <session_number>