Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reorder TMUX sessions?

Tags:

tmux

Is there any way to re-number or swap tmux sessions, just as you can renumber or swap tmux windows? I can't see any command for it and want to easily switch between certain sessions.

like image 855
mahemoff Avatar asked Jul 26 '13 22:07

mahemoff


People also ask

How do I rearrange tmux panes?

To change the layout of panes in a Tmux windows, press <prefix><space> . It will change between different layouts. We may also use command select-layout (or selectl for short) instead.

How do I switch tabs on tmux?

Ctrl + Page Down , Ctrl + Page Up Go to the next, previous tab. In browsers Ctrl + Tab and Ctrl + Shift + Tab also work, but I don't think you can bind C-Tab and C-S-Tab in tmux. Ctrl + Shift + ← , Ctrl + Shift + → Move the current tab left, right (swapping it with the left or right adjacent tab).

How do I resume a tmux session?

To disconnect from your session, but still leave it running, hit Ctrl+B and then D. To resume the session, I can run: $ tmux ls ### to see if there are any other tmux sessions $ tmux a ### this will connect to the most recent session that was created.

How do I get out of tmux session without killing it?

If you want to detach a session instead of simply closing it, use Ctrl-b d (d for "detach"). You can detach with all of the panes still open. To list detached sessions, use the command tmux ls on the command line or within a tmux session.


2 Answers

They're sorted by name (which defaults to a number) You can change the names so that they appear in the order that you prefer.

Outside of tmux:

tmux rename-session -t 0 zzz

inside tmux: C-b $

Or:

c-b : rename session -t current_name new_name

like image 176
Shawn Balestracci Avatar answered Oct 02 '22 08:10

Shawn Balestracci


The default ordering seems to have changed recently from name to index. If you want to put it back to name, try this in your .tmux.conf

bind s choose-tree -sZ -O name
like image 21
Declan Haigh Avatar answered Oct 02 '22 08:10

Declan Haigh