0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[VSCode / tmux] VSCode 上で起動した tmux セッションをダウンさせずに tmux セッションから離脱したい

0
Posted at

1. 概要

VSCode で tmux のセッションに接続すると、 Ctrl + b を押しても、 tmux への指示だとは認識されません。サイドバーがぴこぴこと出現したり閉じたりするだけです🤮

このような場合に、どうすれば tmux のセッション (プロセス) を生かしたままセッションから離脱できるのか。それをこの記事で記載します。

2. 前提

tmux のセッションへの接続は以下のコマンドで実施した場合を想定して、対処法を説明します。

tmux attach -t hogehoge

3. 対処法

3-1. tmux セッション内の terminal でコマンドを実行できる場合

この場合は接続したセッションそのものの window で以下のコマンドを打てば、セッションを抜けられます。 tmux のセッション (プロセス) はダウンせずに生き残り続けます。

tmux detach

3-2. tmux セッション上ではコマンドが実行できない

セッション上で処理が動いていて、 terminal でコマンドが打てない場合があります。

そのような場合は、新たに terminal を追加して、以下のようにコマンドを打てば、 tmux のセッションへの接続を断つことができます。この方法でも tmux のセッション (プロセス) は生き続けます。

tmux detach-client -s hogehoge

結果確認

[detached (from session hogehoge)]

と表示されれば成功です。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?