use env TMUX_CONF_FILE to override default tmux.conf locations, #205

TMUX_CONF_FILE takes precendace over $HOME/.tmux.conf or
XDG_CONFIG_HOME/tmux/tmux.conf which allows internal tpm
scripts to properly parse user_config

E.g in your tmux.conf.local which is sourced by tmux.conf
add set-environment -g "TMUX_CONF_FILE" "/path/to/tmux.conf.local"
This commit is contained in:
pale3 2023-12-19 13:57:12 +01:00
parent 99469c4a9b
commit e693f7bc96

View File

@ -33,7 +33,13 @@ _get_user_tmux_conf() {
}
_tmux_conf_contents() {
user_config=$(_get_user_tmux_conf)
if [ -n "$TMUX_CONF_FILE" ]; then
user_config="$TMUX_CONF_FILE"
else
user_config=$(_get_user_tmux_conf)
fi
cat /etc/tmux.conf "$user_config" 2>/dev/null
if [ "$1" == "full" ]; then # also output content from sourced files
local file