Use multiple byobu sessions, while ignoring unrelated tmux sessions
The tmux program is designed to be run as a single server process that manages one or more independent sessions. The configuration file is loaded by the server process when it starts and is applied to new sessions when they are created. Running tmux new-session
(or, equivalently in this case, byobu new-session
) contacts the running server if there is one, and requests that it create a new session. The server uses a known path for its socket based only on the UID of the user, and that is all that is needed to connect to a running tmux server. So this is why if a "normal" tmux session is already running, byobu will either attach to or create a new session using that server.
According to the tmux man page, you can simply change the socket used by tmux to start two independent tmux servers, each with their own sets of configuration if desired. You can either specify -L
to change the base name of the socket or the -S
option to specify a completely different path to the socket file. The default tmux socket is named default
.
So, using these tmux options when calling byobu, to start an independent tmux server with byobu, you can run
byobu -L my-byobu new
or
byobu -L my-byobu attach
where the name my-byobu
can be replaced with any name of your choice. This starts a new tmux server with the name my-byobu
, which loads the byobu configuration for tmux instead of the default, and effectively creates an independent namespace for your byobu tmux sessions.