Tmux/ru

(terminal multiplexer) is a program that enables a number of terminals (or windows), each running a separate program, to be created, accessed, and controlled from a single screen or terminal window. may be detached from a screen and continue running in the background, then later reattached. Users familiar with GNU Screen may find tmux as a good alternative.

Emerge
Install :

Конфигурация
Standard installation of will not install a global  or user  configuration file. Examples are provided in the directory and can be copied to a world or user location and edited as desired using a text editor.

Package examples
To see a list of configuration files, run the following command:

Then use to move one of the files to either the global location (which will affect all users) or to the user's home directory.

Пример файла конфигурации
Пример файла конфигурации :

Расширения
A few plugins are available for. See the sections below for available options.

tmux-mem-cpu-load
is a small program designed to monitor system activity in the status line of. See the sub-article for more details on the installation process.

Tmux Resurrect
persists environments across system restarts. See the Tmux Resurrect sub-article for more details on the installation process.

функциональные комбинации клавиш
tmux может управляться из присоединенного клиента посредством клавиатурных комбинаций системная кнопка с нажатой клавишей (+ по умолчанию) за которой следует нажатие коммандной кнопки.

После нажатия + следующие клавиатурные комбинации могут быть использованы:

Общие комбинации


 * = Показать все клавиатурные комбинации.
 * = Отсоеденить текущий клиент.
 * = Перейти к командной строке tmux

Создание и управление окнами

 * = Создать новое окно
 * = Перейти к следующему окну.
 * = Перейти к предыдущему окну.
 * = Перейти к предыдущему выбранному окну.
 * = Выбрать окна от 0 до 9.
 * = Перейти к выбору индекса окна. Потом необходимо ввести номер о название чтобы перейти к соответствующему окну.
 * = Переименовать текущее окно.
 * = Выбрать окно в интерактивном режиме.
 * , then type list-windows = Display the list of windows.

Создание и управление панелями

 * = Разделить текущую панель на две, верхную и нижнию.
 * = Разделить текущую панель на две, левую и правую.
 * = Выбрать следующую панель отображаемую в данном окне.
 * = Перейти в предыдущей активной панели
 * {{Key|{}} = Поменять местами текущую панель с предыдущей
 * {{Key| } }} = Поменять местами текущую панель со следующей панелью.
 * + = Rotate the panes in the current window forwards. * + to + = Arrange panes in one of the five preset layouts: even-horizontal, even-vertical, main-horizontal, main-vertical, or tiled. * = Kill the current pane. *  = Break the current pane out of the window

Copy, paste, and scroll operations
The keys available depend on whether emacs (default) or vi mode is selected. The mode-keys option can be set in for vi mode.


 * = Enter copy mode to copy text or view the history.
 * = Paste the most recently copied buffer of text.
 * = List all paste buffers.
 * = Delete the most recently copied buffer of text.

Start session
Once started creates a socket for the session in

can be started with the following command:

Or, to give the session a name on start up, run:

Listing sessions
List sessions to see existing session information:

When listing sessions the name of the session should appear as the first item in the session information line. It is possible to see from the output above the session was created without a name, hence the session is to be referenced as.

Another way to list sessions is by typing out the long  argument.

The exact same output as the previous list command is displayed.

Renaming a session
Simply using to start a session will not provide the session with a nice, human readable name.

If the default session name is not descriptive enough ( does not tend to describe much), then a session can be renamed. Suppose Larry the cow started without specifying a session name on start up. He begins working on compiling a new version of Portage, and wants to change the session name to reflect his current task. To change the session name he would first assume control of by pressing the magic key stroke: +, then  which will drop focus into the  control line. By default the line should turn yellow. Once there he would issue:

Where  is the existing (default) session name and   is the desired name for the new session. To rename when detached from a session issue:

Resuming a session
After the session is detached, all the active terminals remain active and so do commands that did not finish yet. To resume a session use.

Or use the long way of attaching to an existing session:

Daemon-like operation
To start a command in a session without attaching to the session (like a daemon) use   followed by the command to execute in quotes:

Смотрите также

 * Screen - An alternative to tmux.

External resources

 * An excellent primer.