当您从本地 tmux 会话通过 SSH 连接到删除 tmux 会话时,如何将命令密钥传递给远程 tmux 会话 [英] How to pass command keys to a remote tmux session when you SSH from a local tmux session into a remove tmux session

查看:40
本文介绍了当您从本地 tmux 会话通过 SSH 连接到删除 tmux 会话时,如何将命令密钥传递给远程 tmux 会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

解决方案

可以设置

bind-key b 发送前缀

在您的 .tmux.conf 中.默认情况下,所有命令都转到最外层的 tmux 会话.如果你按下

b (

=ctrlb 默认情况下)命令进入内部会话.举个例子:

ctrl-b c # 在外层会话中创建新窗口ctrl-b b c # 在内部会话中创建新窗口ctrl-b % # 在外部会话中创建拆分窗口ctrl-b b % # 在内部会话中创建拆分窗口

I would like to use my ssh tmux session inside my development tmux session, but it makes tmux behave bad (keys go to wrong session, etc). Is there a way to do it properly?

解决方案

You can set up

bind-key b send-prefix

in your .tmux.conf. By default all commands go to the outermost tmux session. If you press <prefix-key>b (<prefix-key>=ctrlb by default) the commands go to the inner session. Here an example:

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

这篇关于当您从本地 tmux 会话通过 SSH 连接到删除 tmux 会话时,如何将命令密钥传递给远程 tmux 会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆