How to reload tmux config file which has defined multiple sessions?
Build a wrapper
I think your needs are best served by some form of wrapper script to setup custom sessions. Something like the answer to this one.
It would look something like this, but you should change it for your specific needs.
#!/bin/bash
# test if the session has windows
is_closed(){
sess=$1
n=$(tmux ls 2> /dev/null | grep "^$sess" | wc -l)
[[ $n -eq 0 ]]
}
# either create it or attach to it
if is_closed logi ; then
tmux new -d -s logi -n cmd
tmux neww -t logi -n logi "cat /dev/logi | ccze -m ansi -p syslog -C"
tmux splitw -t logi:1 -v -p 50
tmux selectw -t logi:2
tmux selectp -t logi:1
fi
if is_closed standard ; then
tmux new -d -s standard -n htop "htop"
tmux neww -n cmd -t standard
tmux splitw -t standard:2 -v -p 50
tmux selectw -t standard:2
tmux selectp -t standard:1
fi
To reload a configuration file
If you make an edit to the configuration file while using tmux, you can run this is the prompt
tmux source-file /path/to/conf
Or, you can bind it to a key in .tmux.conf
bind r source-file ${HOME}/.tmux.conf \; display-message "source-file reloaded"
Home directory configurations
Finally, you really shouldn't be adding significant customizations to /etc/tmux.conf
because this would be unhelpful to others if you need to use a shared system. Instead, I suggest you add any customization to ~/.tmux.conf
because it's local and specific to your personal needs.