Tmux/ja

(terminal multiplexer) はそれぞれ別のプログラムが動作する多くの端末(もしくはウィンドウ)を、一つの画面もしくは端末のウィンドウから作成し、アクセス、管理することを可能にするプログラムです. は画面から分離しバックグラウンドで動き続け、後々画面に合流することもできます. Screenに慣れ親しんだユーザーにとって、tmuxは良い代替ソフトになるでしょう.

Emerge
をインストール:

設定
の基本的なインストールでは、グローバル もしくはパーソナルな設定ファイルを用意しません. 設定例は に存在するので、グローバルもしくはパーソナルな場所にコピーし、好みのtext editorを使って編集することができます.

Packageの例
設定ファイルをリストで見るために、次のコマンドを実行してください.

ではコマンドを使用して設定ファイルをグローバルな場所(すべてのユーザーに影響)もしくはユーザーのホームディレクトリに移動してください.

Wikiでの例
これはの一例です:

プラグイン
僅かながらpluginsがで利用可能です. 以下の章で利用可能なオプションを確認してください.

tmux-mem-cpu-load
はのステータスを示す行でシステムをモニターするように設計された小さなプログラムです. インストールに関する詳細は別の記事(Tmux/plugins/tmux-mem-cpu-load )を確認してください.

Tmux Resurrect
はシステム再起動を跨いで 環境を維持します. インストール手順のさらなる詳細については resurrect サブ記事をお読みください.

キー・バインディング
tmux can be controlled from an attached client by using a key combination of a prefix key stroke (+ by default) followed by a command key.

After pressing + the following key combinations can be used:

一般操作

 * = List all key bindings.
 * = Detach the current client.
 * = Enter the tmux command prompt.

ウィンドウの作成や管理

 * = Create a new window
 * = Change to the next window.
 * = Change to the previous window.
 * = Move to the previously selected window.
 * = Select windows 0 to 9.
 * = Prompt for a window index to select. Then enter a number or title to switch to that window.
 * = Rename the current window.
 * = Choose the current window interactively.
 * , then type list-windows = Display the list of windows.

ペインの作成や管理

 * = Split the current pane into two, top and bottom.
 * = Split the current pane into two, left and right.
 * = Select the next pane in the current window.
 * = Move to the previously active pane.
 * {{Key|{}} = Swap the current pane with the previous pane.
 * {{Key| } }} = Swap the current pane with the next pane.
 * + = 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.

コピーや貼り付け、スクロールの操作
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.

セッションの開始
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:

セッションのリスト表示
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.

セッション名の変更
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 new name for the 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 - tmux 以外の選択肢

外部の情報

 * An excellent tmux primer