0

I have tmux and wanted to set some custom configurations, but I cannot find a default tmux.conf file.

tmux -V          
tmux 3.3a

According to the manpage:

-f file
Specify an alternative configuration file. By default, tmux loads the system configuration file from /etc/tmux.conf, if present, then looks for a user configuration file at ~/.tmux.conf, $XDG_CONFIG_HOME/tmux/tmux.conf or ~/.config/tmux/tmux.conf.

However, there was no file at any of these locations. I created ~/.tmux.conf, but nothing I did there seemed to have any effect even when I ran tmux -f ~/.tmux.conf I even put some random nonsense in tmux.conf hoping it would throw an error message, but no luck.

$ cat  ~/.tmux.conf
fdsghdfghhnvn fhgfj dsfgdgh

# Toggle mouse on/off
bind-key m \                  
set-option -gF mouse "#{?mouse,off,on}" \;\
display-message "#{?mouse,Mouse: ON,Mouse: OFF}"

#set color
setw -g status-style fg=white,bg=black


# panes
set -g pane-border-style 'fg=colour19 bg=colour0'
set -g pane-active-border-style 'bg=colour0 fg=colour9'

However, it is obviously getting configurations from somewhere:

tmux show -g         
activity-action other
assume-paste-time 1
base-index 0
bell-action any
default-command ''
default-shell /usr/bin/zsh
default-size 80x24
destroy-unattached off
detach-on-destroy on
display-panes-active-colour red
display-panes-colour blue
display-panes-time 1000
display-time 750
history-limit 2000
key-table root
lock-after-time 0
lock-command "lock -np"
message-command-style bg=black,fg=yellow
message-style bg=yellow,fg=black
mouse off
prefix C-b
prefix2 None
renumber-windows off
repeat-time 500
set-titles off
set-titles-string "#S:#I:#W - \"#T\" #{session_alerts}"
silence-action other
status on
status-bg default
status-fg default
status-format[0] "#[align=left range=left #{E:status-left-style}]#[push-default]#{T;=/#{status-left-length}:status-left}#[pop-default]#[norange default]#[list=on align=#{status-justify}]#[list=left-marker]<#[list=right-marker]>#[list=on]#{W:#[range=window|#{window_index} #{E:window-status-style}#{?#{&&:#{window_last_flag},#{!=:#{E:window-status-last-style},default}}, #{E:window-status-last-style},}#{?#{&&:#{window_bell_flag},#{!=:#{E:window-status-bell-style},default}}, #{E:window-status-bell-style},#{?#{&&:#{||:#{window_activity_flag},#{window_silence_flag}},#{!=:#{E:window-status-activity-style},default}}, #{E:window-status-activity-style},}}]#[push-default]#{T:window-status-format}#[pop-default]#[norange default]#{?window_end_flag,,#{window-status-separator}},#[range=window|#{window_index} list=focus #{?#{!=:#{E:window-status-current-style},default},#{E:window-status-current-style},#{E:window-status-style}}#{?#{&&:#{window_last_flag},#{!=:#{E:window-status-last-style},default}}, #{E:window-status-last-style},}#{?#{&&:#{window_bell_flag},#{!=:#{E:window-status-bell-style},default}}, #{E:window-status-bell-style},#{?#{&&:#{||:#{window_activity_flag},#{window_silence_flag}},#{!=:#{E:window-status-activity-style},default}}, #{E:window-status-activity-style},}}]#[push-default]#{T:window-status-current-format}#[pop-default]#[norange list=on default]#{?window_end_flag,,#{window-status-separator}}}#[nolist align=right range=right #{E:status-right-style}]#[push-default]#{T;=/#{status-right-length}:status-right}#[pop-default]#[norange default]"
status-format[1] "#[align=centre]#{P:#{?pane_active,#[reverse],}#{pane_index}[#{pane_width}x#{pane_height}]#[default] }"
status-interval 15
status-justify left
status-keys vi
status-left "[#{session_name}] "
status-left-length 10
status-left-style default
status-position bottom
status-right "#{?window_bigger,[#{window_offset_x}#,#{window_offset_y}] ,}\"#{=21:pane_title}\" %H:%M %d-%b-%y"
status-right-length 40
status-right-style default
status-style bg=green,fg=black
update-environment[0] DISPLAY
update-environment[1] KRB5CCNAME
update-environment[2] SSH_ASKPASS
update-environment[3] SSH_AUTH_SOCK
update-environment[4] SSH_AGENT_PID
update-environment[5] SSH_CONNECTION
update-environment[6] WINDOWID
update-environment[7] XAUTHORITY
visual-activity off
visual-bell off
visual-silence off
word-separators "!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~"
~$ rpm -ql tmux


/run/tmux
/usr/bin/tmux
/usr/lib/tmpfiles.d/tmux.conf
/usr/share/bash-completion/completions/tmux
/usr/share/doc/packages/tmux
/usr/share/doc/packages/tmux/CHANGES
/usr/share/licenses/tmux
/usr/share/licenses/tmux/COPYING

~$ cat /usr/lib/tmpfiles.d/tmux.conf 
d /run/tmux 1777 root root -

I also ran strace tmux and the output seems relevant, but I'm not sure what to do about it.

getcwd("/home/james", 4096)             = 12
readlink("/home", 0x7ffcbb31fae0, 1023) = -1 EINVAL (Invalid argument)
readlink("/home/james", 0x7ffcbb31fae0, 1023) = -1 EINVAL (Invalid argument)
readlink("/home", 0x7ffcbb31fae0, 1023) = -1 EINVAL (Invalid argument)
readlink("/home/james", 0x7ffcbb31fae0, 1023) = -1 EINVAL (Invalid argument)
readlink("/etc", 0x7ffcbb320aa0, 1023)  = -1 EINVAL (Invalid argument)
readlink("/etc/tmux.conf", 0x7ffcbb320aa0, 1023) = -1 ENOENT (No such file or directory)
readlink("/home", 0x7ffcbb320aa0, 1023) = -1 EINVAL (Invalid argument)
readlink("/home/james", 0x7ffcbb320aa0, 1023) = -1 EINVAL (Invalid argument)
readlink("/home/james/.tmux.conf", 0x7ffcbb320aa0, 1023) = -1 EINVAL (Invalid argument)
readlink("/home", 0x7ffcbb320aa0, 1023) = -1 EINVAL (Invalid argument)
readlink("/home/james", 0x7ffcbb320aa0, 1023) = -1 EINVAL (Invalid argument)
readlink("/home/james/.config", 0x7ffcbb320aa0, 1023) = -1 EINVAL (Invalid argument)
readlink("/home/james/.config/tmux", 0x7ffcbb320aa0, 1023) = -1 ENOENT (No such file or directory)
access("/usr/bin/zsh", X_OK)            = 0
getuid()                                = 1000

I am on OpenSUSE Tumbleweed.

2

1 Answer 1

2

Ok, I figured it out. All I needed to do was:

tmux kill-server

then run tmux again and it used my conf file without being specified

3
  • 2
    You don't have to kill the server to reload config. Use tmux source-file ~/.tmux.conf. Feb 25, 2023 at 10:38
  • Is that different from tmux -f ~/.tmux.conf? Because that didn't work.
    – Stonecraft
    Feb 25, 2023 at 13:52
  • 2
    yes, it is different. Feb 26, 2023 at 15:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .