How to send commands when opening a tmux session inside another tmux session?

前端 未结 3 1375
我在风中等你
我在风中等你 2020-12-12 09:36

A typical situation may be:

$ tmux
  [0] $ ssh example.com
      $ tmux attach
        [0] $ 

I open a tmux session, then ssh in to a serve

3条回答
  •  生来不讨喜
    2020-12-12 10:18

    EDIT:

    I do NOT recommend use C-q as a bind-key, as it is a default control-key command for

    un-freezes the screen and lets screen display continue

    A situation happens here, and @Paschalis provides a solution:

    if it happens to be twice unlucky (a remote tmux session with C-q as prefix): Type Cltr-q, then :, and enter in tmux: send-keys C-q

    Below it is the answer:


    To make it simple, add the below line in your ~/.tmux.conf

    bind-key -n C-q send-prefix
    

    Then you can directly use C-q as bind-key for your remote tmux.

提交回复
热议问题