tmux 嵌套 tmux_Tmux实践:本地和嵌套远程tmux会话

本文介绍了tmux的功能,如终端多路复用、会话管理和窗口拆分,以及在本地和远程场景中的应用。重点讨论了如何设置和配置tmux以支持嵌套的本地和远程会话,包括在远程会话中使用tmux并保持会话状态的持久性和网络断开连接后的恢复能力。此外,还探讨了如何在外部会话中禁用键绑定处理,以实现更流畅的嵌套使用体验。
摘要由CSDN通过智能技术生成

tmux 嵌套 tmux

by Alexey Samoshkin

通过阿列克谢·萨莫什金(Alexey Samoshkin)

Tmux实践:本地和嵌套远程tmux会话 (Tmux in practice: local and nested remote tmux sessions)

我们讨论了tmux功能,它们与本地和远程方案的相关性以及如何设置和配置tmux以支持嵌套会话 (We discuss tmux features, their relevance for local and remote scenarios, and how to setup and configure tmux to support nested sessions)

This is the first part of my tmux in practice article series. It is about using and configuring tmux v2, local and remote tmux sessions usage, and how to support a scenario when a remote tmux session is going to be nested inside a local tmux session.

这是我的tmux实践文章系列的第一部分。 它是关于使用和配置tmux v2,本地和远程tmux会话的用法,以及如何支持将远程tmux会话嵌套在本地tmux会话中的情况。

Before you start reading, here is a working example from my machine. We have a local tmux session on OSX inside iTerm2 (run in full screen mode). The local session has 2 windows: “zsh” and “node”.

在开始阅读之前,这是我机器上的一个有效示例 。 我们在iTerm2中的OSX上有一个本地tmux会话(以全屏模式运行)。 本地会话有2个窗口:“ zsh”和“ node”。

The “zsh” window is split into 2 panes: in both panes we SSH’ed to the remote hosts (CentOS7 and Ubuntu14) and jump into remote tmux sessions there.

“ zsh”窗口分为两个窗格:在两个窗格中,我们都通过SSH方式连接到远程主机(CentOS7和Ubuntu14),然后跳到那里的远程tmux会话。

The bottom pane with the Ubuntu14 remote session is further split into 2 panes, and we have 3 windows: shell, mon, and logs.

带有Ubuntu14远程会话的底部窗格进一步分为2个窗格,我们有3个窗口:shell,mon和log。

If you’re curious how it all works together, continue reading.

如果您好奇如何将它们一起使用,请继续阅读。

特征 (Features)

First let’s quickly go through tmux features and advantages, to understand their relevance to local or remote scenarios. We should clarify to ourselves why we need this “nested tmux in tmux” thing, because at first glance it looks pretty crazy.

首先,让我们快速浏览tmux的功能和优点,以了解它们与本地或远程方案的相关性。 我们应该向自己说明为什么我们需要这种“嵌套的tmux in tmux”,因为乍一看它看起来非常疯狂。

  1. Terminal multiplexing, named windows, split window into several panes. This makes more sense for the local environment, when you decide to supercharge your terminal emulator, which otherwise does not support aforementioned features. For example, iTerm or Terminator are already capable of multiplexing a terminal.

    终端多路复用(称为窗口)将窗口分为几个窗格。 当您决定为终端仿真器增压时,这对于本地环境更有意义,否则它将不支持上述功能。 例如,iTerm或Terminator已经能够复用终端。

  2. Setup and kick off tmux session with a pre-configured set of windows and panes, their arrangement, and commands run inside to avoid hassle of repeatedly setting up them again and again from scratch. For example:

    使用一组预先配置的窗口和窗格,它们的排列和命令来设置和启动tmux会话,以

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值