【问题标题】:How to pass command keys to a remote tmux session when you SSH from a local tmux session into a remove tmux session [duplicate]当您从本地 tmux 会话 SSH 到删除 tmux 会话时,如何将命令密钥传递给远程 tmux 会话 [重复]
【发布时间】:2013-07-29 09:54:09
【问题描述】:

我想在我的开发 tmux 会话中使用我的 ssh tmux 会话,但这会使 tmux 表现不佳(密钥进入错误的会话等)。有没有办法正确地做到这一点?

【问题讨论】:

    标签: linux ssh tmux


    【解决方案1】:

    你可以设置

    bind-key b send-prefix
    

    在您的.tmux.conf 中。默认情况下,所有命令都转到最外层的 tmux 会话。如果您按<prefix-key>b(默认为<prefix-key>=ctrlb),命令将转到内部会话。举个例子:

    ctrl-b   c  # create new window in the outer session
    ctrl-b b c  # create new window in the inner session
    ctrl-b   %  # create split window in the outer session
    ctrl-b b %  # create split window in the inner session
    

    【讨论】:

      【解决方案2】:

      至少在我的机器上,我需要按两次“键”(前缀键),才能获得对基础 tmux 内的 tmux 的命令,

      因此,如果我从 tmux 窗口 ssh 进入服务器并附加到上述@Marco 的 tmux 会话,我需要执行以下操作:

      ctrl-b-b c # create a new window on the server (remote tmux)
      ctrl-b   c # create a new window on my desktop (local tmux)
      

      做起来超级清楚,ctrl-b-b表示按住ctrl按两次b然后松开再按命令键,上例中c

      【讨论】:

        猜你喜欢
        • 2021-10-09
        • 1970-01-01
        • 2012-01-21
        • 1970-01-01
        • 2021-07-16
        • 2014-05-11
        • 2014-12-27
        • 1970-01-01
        • 2012-05-05
        相关资源
        最近更新 更多