差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
linux:tmux [2022/09/03 12:40] – [簡単な基本操作] ともやん | linux:tmux [2023/04/23 07:07] (現在) – [参考文献] ともやん | ||
---|---|---|---|
行 2: | 行 2: | ||
====== tmux - terminal multiplexer (端末多重接続ソフトウェア) ====== | ====== tmux - terminal multiplexer (端末多重接続ソフトウェア) ====== | ||
{{windows: | {{windows: | ||
- | 本家: [[http://tmux.github.io/|Home · tmux/ | + | 本家: [[ghi> |
- | ソースコード: | + | ソースコード: |
+ | ドキュメント: | ||
+ | Linux manual: [[https:// | ||
+ | Arch Linux: [[arc> | ||
**tmux** とは、Unix ライクなオペレーティングシステム用の端末多重接続ソフトウェアである。\\ | **tmux** とは、Unix ライクなオペレーティングシステム用の端末多重接続ソフトウェアである。\\ | ||
単一のウィンドウで複数の端末セッションにアクセスできる。同時に複数のコマンドラインプログラムを実行する際に有用である。\\ | 単一のウィンドウで複数の端末セッションにアクセスできる。同時に複数のコマンドラインプログラムを実行する際に有用である。\\ | ||
tmux は制御端末からプロセスを切断することもでき、SSH セッションを SSH 接続をしていない状態でも維持することができる。\\ | tmux は制御端末からプロセスを切断することもでき、SSH セッションを SSH 接続をしていない状態でも維持することができる。\\ | ||
- | [[wpjp>Tmux|tmux - Wikipedia]] より\\ | + | [[wwjp>Tmux|Wikiwand |
===== 簡単な基本操作 ===== | ===== 簡単な基本操作 ===== | ||
行 23: | 行 26: | ||
===== セッションのアタッチ ===== | ===== セッションのアタッチ ===== | ||
- | < | + | < |
- | <code> | + | <WRAP color_command>< |
- | $ tmux a | + | <b class=BOLD> |
- | </code> | + | <b class=GRN> |
+ | <b class=GRN> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== セッションのデタッチ ===== | ||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | <b class=BOLD> | ||
+ | <b class=GRN> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | <b class=GRN> | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
+ | 0: 1 windows (created Fri Oct 14 14:47:17 2022) [110x45] | ||
+ | 1: 1 windows (created Fri Oct 14 14:49:39 2022) [237x35] (attached) | ||
+ | </ | ||
+ | <WRAP color_command>< | ||
+ | <b class=GRN> | ||
+ | <b class=GRN> | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
+ | 0: 1 windows (created Fri Oct 14 14:47:17 2022) [110x45] | ||
+ | 1: 1 windows (created Fri Oct 14 14:49:39 2022) [237x35] | ||
+ | </ | ||
</ | </ | ||
行 33: | 行 64: | ||
**ssh** 再接続後にアタッチできる。\\ | **ssh** 再接続後にアタッチできる。\\ | ||
セッションを確認するには...\\ | セッションを確認するには...\\ | ||
- | < | + | < |
- | <code> | + | <WRAP color_command>< |
- | $ tmux ls | + | <b class=GRN> |
+ | </ | ||
+ | <WRAP color_result>< | ||
0: 1 windows (created Thu Jun 11 04:44:30 2020) | 0: 1 windows (created Thu Jun 11 04:44:30 2020) | ||
- | $ tmux a | + | </ |
- | </code> | + | <WRAP color_command>< |
+ | <b class=GRN> | ||
+ | <b class=GRN> | ||
+ | </ | ||
</ | </ | ||
===== セッションの終了 ===== | ===== セッションの終了 ===== | ||
- | < | + | < |
- | <code> | + | <WRAP color_command>< |
- | $ tmux ls | + | <b class=GRN> |
+ | </ | ||
+ | <WRAP color_result>< | ||
0: 1 windows (created Thu Jun 11 04:44:30 2020) | 0: 1 windows (created Thu Jun 11 04:44:30 2020) | ||
- | $ tmux kill-session | + | </ |
- | $ tmux ls | + | <WRAP color_command>< |
+ | <b class=GRN> | ||
+ | <b class=GRN> | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
no server running on / | no server running on / | ||
- | </code> | + | </pre></ |
+ | </ | ||
+ | |||
+ | ===== カスタマイズ ===== | ||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | <b class=GRN> | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
+ | # | ||
+ | set -g mouse on | ||
+ | # | ||
+ | set-option -g history-limit 100000 | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== Python の libtmux で tmux を操作する ===== | ||
+ | [[python: | ||
+ | \\ | ||
+ | libtmux をインストールする🤔\\ | ||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | <b class=GRN> | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
+ | Collecting libtmux | ||
+ | Downloading libtmux-0.21.0-py3-none-any.whl (47 kB) | ||
+ | <b class=PipBAR> | ||
+ | Installing collected packages: libtmux | ||
+ | Successfully installed libtmux-0.21.0 | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ptpython をインストールする🤔\\ | ||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | <b class=GRN> | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
+ | Collecting ptpython | ||
+ | Downloading ptpython-3.0.23-py2.py3-none-any.whl (63 kB) | ||
+ | <b class=PipBAR> | ||
+ | Collecting appdirs | ||
+ | Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB) | ||
+ | Collecting jedi> | ||
+ | Using cached jedi-0.18.2-py2.py3-none-any.whl (1.6 MB) | ||
+ | Collecting prompt-toolkit& | ||
+ | Using cached prompt_toolkit-3.0.38-py3-none-any.whl (385 kB) | ||
+ | Collecting pygments | ||
+ | Using cached Pygments-2.14.0-py3-none-any.whl (1.1 MB) | ||
+ | Collecting parso& | ||
+ | Using cached parso-0.8.3-py2.py3-none-any.whl (100 kB) | ||
+ | Collecting wcwidth | ||
+ | Using cached wcwidth-0.2.6-py2.py3-none-any.whl (29 kB) | ||
+ | Installing collected packages: wcwidth, appdirs, pygments, prompt-toolkit, | ||
+ | Successfully installed appdirs-1.4.4 jedi-0.18.2 parso-0.8.3 prompt-toolkit-3.0.38 ptpython-3.0.23 pygments-2.14.0 wcwidth-0.2.6 | ||
+ | </ | ||
</ | </ | ||
===== 参考文献 ===== | ===== 参考文献 ===== | ||
- | [[https://qiita.com/nl0_blu/items/ | + | [[https://wiki.archlinux.jp/index.php/Tmux|tmux - ArchWiki]]\\ |
- | [[https://qiita.com/ | + | [[https://libtmux.git-pull.com|libtmux]]\\ |
- | [[https://qiita.com/nmrmsys/items/03f97f5eabec18a3a18b|tmuxチートシート - Qiita]]\\ | + | [[https://www.hostinger.com/tutorials/tmux-beginners-guide-and-cheat-sheet/|tmux: How to Install and Use It + Cheat Sheet]] ([[https://www-hostinger-com.translate.goog/tutorials/tmux-beginners-guide-and-cheat-sheet/? |
- | [[https://qiita.com/taknya/items/cd7bf686f2a4e71e8af8|tmuxの基本的な操作方法のまとめ - Qiita]]\\ | + | |
+ | ==== 付録 ==== | ||
+ | [[tw> | ||