How to execute TMUX commands on a remote server when I have TMUX running locally too?

Startec

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.

Kusalananda

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]

編集
0

コメントを追加

0

関連記事

分類Dev

How do I see the history of the commands I have run in tmux?

分類Dev

How to have tmux apply an option only when vim is not running?

分類Dev

optionally run several commands when starting tmux

分類Dev

How do I scroll in tmux?

分類Dev

Remote tmux session with local tmux client

分類Dev

If I have left and right tmux panes, how can I visually tell which is focused?

分類Dev

Can't use mouse properly when running vim in tmux

分類Dev

Is it possible to add custom commands to tmux?

分類Dev

How can I secure my SSH commands to a remote server in Laravel?

分類Dev

How to detach a tmux session that itself already in a tmux?

分類Dev

How do I execute a remote shell script over SSH and be prompted for passwords by commands that require it in that script?

分類Dev

How can I create a shortcut to resize panes in a tmux window?

分類Dev

How do I get a default tmux configuration file?

分類Dev

tmux - how to display an image in a pane?

分類Dev

I can't open folders in Sublime when I'm using TMUX

分類Dev

How can I keep a python script on a remote server running after closing out of SSH?

分類Dev

How to override logging settings when running azure Functions locally?

分類Dev

Screen: can I execute commands and split the window when starting screen?

分類Dev

Execute Linux commands using ssh2-promise in NodeJS on remote server

分類Dev

How can I bind Alt+Shift+h to previous window in tmux?

分類Dev

How to limit the maximum length of a tmux window name?

分類Dev

How do I run execute commands from a file?

分類Dev

running ssh and executing commands on remote machines

分類Dev

Node Server Running on Ubuntu that needs to execute a C# application - how?

分類Dev

How can I see the actual commands (java) running in Intellij Idea?

分類Dev

Slight delay when switching modes in vim using tmux or screen

分類Dev

unknown command error when loading .tmux.conf

分類Dev

.profile and .bash_profile ignored when starting tmux from .bashrc?

分類Dev

running a simulation software on a remote server

Related 関連記事

  1. 1

    How do I see the history of the commands I have run in tmux?

  2. 2

    How to have tmux apply an option only when vim is not running?

  3. 3

    optionally run several commands when starting tmux

  4. 4

    How do I scroll in tmux?

  5. 5

    Remote tmux session with local tmux client

  6. 6

    If I have left and right tmux panes, how can I visually tell which is focused?

  7. 7

    Can't use mouse properly when running vim in tmux

  8. 8

    Is it possible to add custom commands to tmux?

  9. 9

    How can I secure my SSH commands to a remote server in Laravel?

  10. 10

    How to detach a tmux session that itself already in a tmux?

  11. 11

    How do I execute a remote shell script over SSH and be prompted for passwords by commands that require it in that script?

  12. 12

    How can I create a shortcut to resize panes in a tmux window?

  13. 13

    How do I get a default tmux configuration file?

  14. 14

    tmux - how to display an image in a pane?

  15. 15

    I can't open folders in Sublime when I'm using TMUX

  16. 16

    How can I keep a python script on a remote server running after closing out of SSH?

  17. 17

    How to override logging settings when running azure Functions locally?

  18. 18

    Screen: can I execute commands and split the window when starting screen?

  19. 19

    Execute Linux commands using ssh2-promise in NodeJS on remote server

  20. 20

    How can I bind Alt+Shift+h to previous window in tmux?

  21. 21

    How to limit the maximum length of a tmux window name?

  22. 22

    How do I run execute commands from a file?

  23. 23

    running ssh and executing commands on remote machines

  24. 24

    Node Server Running on Ubuntu that needs to execute a C# application - how?

  25. 25

    How can I see the actual commands (java) running in Intellij Idea?

  26. 26

    Slight delay when switching modes in vim using tmux or screen

  27. 27

    unknown command error when loading .tmux.conf

  28. 28

    .profile and .bash_profile ignored when starting tmux from .bashrc?

  29. 29

    running a simulation software on a remote server

ホットタグ

アーカイブ