~~PAGEIMAGE::tools:tmux:media:20231026-170709.png~~ ====== Tmux ====== {{template>:meta:template:pageinfo#tpl |desc=Document common information about tmux.}} ===== Hotkey ===== Tmux uses __hotkey twice__. The default first one is fixed to Ctrlb, and some common second hotkeys((note:>A full list of supported hotkeys can be found [[http://man.openbsd.org/OpenBSD-current/man1/tmux.1#DEFAULT_KEY_BINDINGS|here]].)) are listed below. ^ Second Hotkey ^ Description ^ | : | Activate the command input mode, then you can use the commands listed in the [[#Commands]] section of this page. | | d | Detach the current client. | | " | Split the current pane into two, top and bottom. | | % | Split the current pane into two, left and right. | | 0 - 9 | Select windows 0 to 9. | | [ | Enter copy mode to copy text or view the history. | | ] | Paste the most recently copied buffer of text. | | c | Create a new window. | | x | Kill the current pane. | | & | Kill the current window. | | f | Prompt to search for text in open windows. | | , | Rename the current window. | ===== Commands ===== ^ Command ^ Description ^ | set -g mouse on | Turn on mouse mode, in which you can switch the window grid or scroll the screen. | | set -g default-terminal %%"%%screen-256color%%"%% | Change the color scheme to ''screen-256color'', which is the default scheme for the Linux shell. | | kill-session -t id/name | Kill the session specified by id or name. | | source /path/to/tmux.conf | Apply /path/to/tmux.conf to the current tmux server. | ===== Configuration File ===== When the tmux server is started, tmux runs a file called .tmux.conf in the user's __home directory__. This file contains a list of tmux commands which are executed in order. .tmux.conf can only be applied when the tmux server is started or when running source path/to/.tmux.conf manually in [[#cmd-input-mode|command input mode]], not when a new session is created.((ref:>https://github.com/tmux/tmux/wiki/Getting-Started#the-configuration-file)) For example, add the following commands ((note:>Run tmux -V to get the tmux version, then select the appropriate commands.)) to .tmux.conf, then reopen a new terminal and run tmux to start tmux server. * Versions after (and including) 2.1 set -g mouse on set -g default-terminal "screen-256color" * Versions before 2.1 set -g mode-mouse on set -g mouse-resize-pane on set -g mouse-select-pane on set -g mouse-select-window on {{template>meta:template:refnote#note}} {{template>meta:template:refnote#ref}} ===== Further Reading ===== * //[[https://github.com/tmux/tmux/wiki/Getting-Started#configuring-tmux]]//