How to change the order of TMUX sessions?

Is there a way to redial or replace tmux sessions, just as you can renumber or replace tmux windows? I do not see any command for this and want to easily switch between certain sessions.

+7
tmux
source share
2 answers

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

Outside of tmux:

tmux rename session -t 0 zzz

inside tmux: Cb $

Or:

cb : rename session -t current_name new_name

+11
source share

If you want to manually order sessions, you can prefix the session name with a zero width or an invisible Unicode character , For example:

 $ tmux rename-session -t charlie $(echo -e "\u200B")charlie $ tmux rename-session -t beta $(echo -e "\u200C")beta $ tmux rename-session -t alpha $(echo -e "\u200D")alpha $ tmux list-sessions charlie: 1 windows (created Sun Nov 2 12:39:30 2014) [284x87] (attached) beta: 1 windows (created Sun Nov 2 12:39:27 2014) [284x87] alpha: 1 windows (created Sun Nov 2 12:39:23 2014) [284x87] 

The downside is that you still have to refer to the session using these characters.

+1
source share

All Articles