I am not sure if this is possible but I have a remote server running tmux
and I frequently ssh
into that server from a computer that is also running tmux
.
The issue is that the tmux.conf
filed are the same so when I try to run a command like detach
with prefix-d
I detach from my local tmux
session when I actually want to detach from the remote one.
I do not see anyway around this other than having separate tmux.conf
files but I thought I would check.
When you have nested tmux
sessions, it is the first ("outermost", oldest) that gets the Ctrlb+d key sequence to detach.
You can set up tmux
to send its prefix key to the "inner" session like this (in your ~/.tmux.conf
):
bind-key b send-prefix
This will send the prefix Ctrlb (or whatever you use as prefix) when you press Ctrlb+b, so Ctrlb+b is basically "the prefix for the inner (of two) tmux
sessions".
Sending Ctrlb+b+d will then detach the inner tmux
session.
Splitting the pane of the innermost session: Ctrlb+b+"
The above assumes two nested sessions. Detaching the innermost of three sessions: Ctrlb+b+b+d
To simplify this, set up a separate "prefix" for nested sessions as explained in the answer to a similar question.
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加