LoginSignup
27
27

More than 5 years have passed since last update.

これで再起動しても大丈夫!tmux-resurrectの導入

Posted at

tmuxを使っていると再起動するとセッションが消えてしまうので保存できないか調べてみたところ、tmux-resurrectというプラグインで可能になるらしい。
ついでにプラグイン管理にtpm(tmux plugin manager)も導入する。

tpmとプラグインの導入

$ git clone github.com/tmux-plugins/tpm
tmux.conf
#追加する
if-shell "test -d ~/path/to/dir" "run-shell '~/path/to/dir/tpm'"

set -g @tpm_plugins '                \
  tmux-plugins/tpm                   \
  tmux-plugins/tmux-resurrect        \
  tmux-plugins/tmux-resurrect-auto   \
'
$ tmux source-file ~/.tmux.conf #リロード

使い方

prefix+Iでプラグインのインストール。新しくプラグインを追加したら実行する。
prefix+ctrl-Sで現在のsessionを保存する。
prefix+ctrl-Rで保存したsessionをリストアする。

手動で保存とか絶対忘れるのでtmux-resurrect-autoも導入した。
これで1分に1回自動で保存してくれる。

tpm自体まだ開発がされているものらしくpluginの数も少ないけどこれからに期待。
なにか便利なpluginがあったら教えてほしい。

27
27
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
27
27