Different tmux configs for different sessions

configurationtmux

We have a centos 7 machine that many developers use with tmux 1.8 under the same user. Is it possible for us to have personal configs for each tmux session, while also leaving the default config intact for new (default) sessions?

Best Answer

As @asmodean correctly mentioned, the way to use multiple tmux instances on the same machine (with the same user) is to use two different sockets. A socket name can be given using -L option.

Usage

Create tmux instances

  • first session: tmux -L userA -f ~/.tmux-userA.conf

  • second session: tmux -L userB -f ~/.tmux-userB.conf

Join instances

tmux -L userA attach tmux -L userB attach

Other tmux commands

Other commands work with -L option. For example, to list userA and userB sessions:

tmux -L userA list-sessions tmux -L userB list-sessions