LoginSignup
2
1

More than 5 years have passed since last update.

reptyrで動作中のプロセスを別のptyにアタッチする

Last updated at Posted at 2016-12-25

sshでログイン

vimでファイル編集

ssh切れる

ssh再度ログイン

再びvimでファイル編集しようとすると、.swpファイルがある

psで確認すると、サーバ側でsshのセッション残ったまま

こういう状態で、既にクライアント側を終了してしまったsshのセッションで起動しているvimを、いま開いているsshのセッションから横取りしたい。
こういうときはreptyrを使えばいいみたい。

インストール

apt-get install reptyr

vimを横取りする

ps aux |grep vim  # 既に起動中のvimのpidを調べる
reptyr -s 調べたpid

参考: http://blog.daionet.gr.jp/knok/2014/10/31/reptyr/

2
1
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
2
1