Score:0

tmux inside a remote tmux

cn flag

What happens if I remote login to a PC start tmux there and from there remote login to another pc and start tmux there?

I did it once, and when dettaching, it dettached from the first tmux.

Is there a way to dettach only from the second one?

Score:4
vn flag

This presents an interesting situation. Think of tmux as an extra abstraction layer that interprets your keystrokes (among a decent amount of other stuff).

The problem here is that both tmux instances are probably configured with Ctrl+b as the prefix key. This means only the first instance actually catches the prefix command.

To get around this, configure another key combination than Ctrl+b as the prefix key for either session. In this example, I'll go with configuring Ctrl+f as the prefix key for the second machine (but it could be the other way around).

Add the following to your ~/.tmux.conf on the second machine:

# Set prefix key to C-f
unbind C-b
set -g prefix C-f
bind C-f send-prefix

Now the prefix key on the second machine is Ctrl+f instead of Ctrl+b.

Now, if you press Ctrl+f and then d, you detach from the second tmux session.

And when you press Ctrl+b and then d, you detach from the first tmux session.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.