4

I've been trying some .tmux.conf files but now I'd like to go back to the original/default configuration. How can I do it? I've been looking for the default file but no luck.

5

Here's the list of default options that are taken from revision 1.51 of window-options.c in the tmux source from OpenBSD-current (this is the development version, sync'ed quite frequently with sourceforge).

# Server options.
buffer-limit  20
escape-time  500
exit-unattached  0
focus-events  0
message-limit  100
quiet  0
set-clipboard  1
terminal-overrides  "*256col*:colors=256,xterm*:XT:Ms=\\E]52;%p1%s;%p2%s\\007:Cs=\\E]12;%p1%s\\007:Cr=\\E]112\\007:Ss=\\E[%p1%d q:Se=\\E[2 q,screen*:XT"

# Session options.
assume-paste-time  1,
base-index  0
bell-action  any
bell-on-alert  0
default-command  ""
default-shell  _PATH_BSHELL
default-terminal  "screen"
destroy-unattached  0
detach-on-destroy  1
display-panes-active-colour  1
display-panes-colour  4
display-panes-time  1000
display-time  750
history-limit  2000
lock-after-time  0
lock-command  "lock -np"
lock-server  1
message-attr  0,
message-bg  3,
message-command-attr  0,
message-command-bg  0,
message-command-fg  3,
message-command-style  "bg=black,fg=yellow"
message-fg  0,
message-style  "bg=yellow,fg=black"
mouse-resize-pane  0
mouse-select-pane  0
mouse-select-window  0
mouse-utf8  0
pane-active-border-bg  8,
pane-active-border-fg  2,
pane-active-border-style  "fg=green"
pane-border-bg  8,
pane-border-fg  8,
pane-border-style  "default"
prefix C-b
prefix2  KEYC_NONE,
renumber-windows  0
repeat-time  500
set-remain-on-exit  0
set-titles  0
set-titles-string  "#S:#I:#W - \"#T\""
status  1
status-attr  0,
status-bg  2,
status-fg  0,
status-interval  15
status-justify  0
status-keys emacs
status-left  "[#S] "
status-left-attr  0,
status-left-bg  8,
status-left-fg  8,
status-left-length  10
status-left-style  "default"
status-position  1
status-right  " \"#{=22:pane_title}\" %H:%M %d-%b-%y"
status-right-attr  0,
status-right-bg  8,
status-right-fg  8,
status-right-length  40
status-right-style  "default"
status-style  "bg=green,fg=black"
status-utf8  0 # overridden in main()
update-environment  "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
visual-activity  0
visual-bell  0
visual-silence  0
word-separators  " -_@"

# Window options.
aggressive-resize  0
allow-rename  1
alternate-screen  1
automatic-rename  1
automatic-rename-format  "#{?pane_in_mode,[tmux],#{pane_current_command}}#{?pane_dead,[dead],}"
c0-change-trigger  250,
c0-change-interval  100,
clock-mode-colour  4
clock-mode-style  1
force-height  0
force-width  0
main-pane-height  24
main-pane-width  80
mode-attr  0,
mode-bg  3,
mode-fg  0,
mode-keys  emacs
mode-mouse  0
mode-style  "bg=yellow,fg=black"
monitor-activity  0
monitor-silence  0
other-pane-height  0
other-pane-width  0
pane-base-index  0
remain-on-exit  0
synchronize-panes  0
utf8  0 # overridden in main()

wrap-search  1
xterm-keys  0

# XXX: not sure how to transcribe these
window-status-activity-attr  GRID_ATTR_REVERSE,
window-status-activity-bg  8,
window-status-activity-fg  8,
window-status-activity-style  "reverse"
window-status-attr  0,
window-status-bell-attr  GRID_ATTR_REVERSE,
window-status-bell-bg  8,
window-status-bell-fg  8,
window-status-bell-style  "reverse"
window-status-bg  8,
window-status-current-attr  0,
window-status-current-bg  8,
window-status-current-fg  8,
window-status-current-format  "#I:#W#F"
window-status-current-style  "default"
window-status-fg  8,
window-status-format  "#I:#W#F"
window-status-last-attr  0,
window-status-last-bg  8,
window-status-last-fg  8,
window-status-last-style  "default"
window-status-separator  " "
window-status-style  "default"

The default key bindings from key-bindings.c

 bind C-b send-prefix
 bind C-o rotate-window
 bind C-z suspend-client
 bind Space next-layout
 bind ! break-pane
 bind '\"' split-window
 bind '#' list-buffers
 bind '$' command-prompt -I'#S' \"rename-session '%%'\"
 bind % split-window -h
 bind & confirm-before -p\"kill-window #W? (y/n)\" kill-window
 bind \"'\" command-prompt -pindex \"select-window -t ':%%'\"
 bind ( switch-client -p
 bind ) switch-client -n
 bind , command-prompt -I'#W' \"rename-window '%%'\"
 bind - delete-buffer
 bind . command-prompt \"move-window -t '%%'\"
 bind 0 select-window -t:0
 bind 1 select-window -t:1
 bind 2 select-window -t:2
 bind 3 select-window -t:3
 bind 4 select-window -t:4
 bind 5 select-window -t:5
 bind 6 select-window -t:6
 bind 7 select-window -t:7
 bind 8 select-window -t:8
 bind 9 select-window -t:9
 bind : command-prompt
 bind \\; last-pane
 bind = choose-buffer
 bind ? list-keys
 bind D choose-client
 bind L switch-client -l
 bind [ copy-mode
 bind ] paste-buffer
 bind c new-window
 bind d detach-client
 bind f command-prompt \"find-window '%%'\"
 bind i display-message
 bind l last-window
 bind n next-window
 bind o select-pane -t:.+
 bind p previous-window
 bind q display-panes
 bind r refresh-client
 bind s choose-tree
 bind t clock-mode
 bind w choose-window
 bind x confirm-before -p\"kill-pane #P? (y/n)\" kill-pane
 bind z resize-pane -Z
 bind { swap-pane -U
 bind } swap-pane -D
 bind '~' show-messages
 bind PPage copy-mode -u
 bind -r Up select-pane -U
 bind -r Down select-pane -D
 bind -r Left select-pane -L
 bind -r Right select-pane -R
 bind M-1 select-layout even-horizontal
 bind M-2 select-layout even-vertical
 bind M-3 select-layout main-horizontal
 bind M-4 select-layout main-vertical
 bind M-5 select-layout tiled
 bind M-n next-window -a
 bind M-o rotate-window -D
 bind M-p previous-window -a
 bind -r M-Up resize-pane -U 5
 bind -r M-Down resize-pane -D 5
 bind -r M-Left resize-pane -L 5
 bind -r M-Right resize-pane -R 5
 bind -r C-Up resize-pane -U
 bind -r C-Down resize-pane -D
 bind -r C-Left resize-pane -L
 bind -r C-Right resize-pane -R

There are further key bindings (vi and emacs copy-mode and status-line editing keys) defined in mode-keys.c which I didn't bother to extract.

  • Here's the link to key-bindings.c which I wasn't allowed to include in the answer – ariane Dec 22 '14 at 16:17
  • I think the tmux source on Github now includes this information in options-table.c instead of window-options.c. I can't find window-options.c in that repo. – David Winiecki Feb 29 '16 at 22:52
1

tmux takes it defaults from the compiled in values, overruled by /etc/tmux.conf and then by ~/.tmux.conf. If the latter is not present it will just work with the other values. That means you can just delete the ~/.tmux.conf or leave it empty.

Both on Ubuntu 12.04 nor on Linux Mint 17 there seems to be a default /etc/tmux.conf file (in which case the compiled in default values are taken).

  • I don't have /etc/tmux.conf. Is there a place where I can copy paste the default settings? – Jay Dec 22 '14 at 15:46
  • @Jay Neither do I, that means the internal defaults are taken. There is no (documented) way to dump these internal defaults to a file (some other programs have these). So you can leave out the file and get what you want. – Anthon Dec 22 '14 at 15:50
0

The other answers include some very useful information that implies the answer but I think they haven't quite answered the question explicitly.

If I understand the tmux man page correctly, you can reset a given option to the default with tmux set -u -g <option>.

The only way I know to restore all the options at once is to reinstall tmux.

I think the reference ariane provided (or at least part of it) was generated right after installing tmux using tmux show -g, tmux show -g -s, and tmux show -g -w to get the session, server, and window options.

0

You can obtain the default settings with

$ tmux -f /dev/null show-options -s \; show-options -g \; list-keys > tmux.defaults.conf

The -f /dev/null specifies a null configuration file, so what you end up with is whatever is hard-coded in the source.

Once that's captured in a file you could, in theory, use it as a source file:

$ tmux unbind-key -a
$ tmux source-file tmux.defaults.conf

I say in theory because you will need to play around with the escaping within the extracted tmux.conf before it will source correctly. The unbind-key is there to clean key-bindings out prior to loading the tmux.conf. I am not sure if there's a way to clear out options en-masse.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.