.tmux

授权协议 View license
开发语言 SHELL
所属分类 应用工具、 文档/文本编辑
软件类型 开源软件
地区 不详
投 递 者 岳硕
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

.tmux

Self-contained, pretty and versatile .tmux.conf configuration file.

Screenshot

Installation

Requirements:

  • tmux >= 2.3 (soon >= 2.4) running inside Linux, Mac, OpenBSD, Cygwinor WSL
  • awk, perl and sed
  • outside of tmux, $TERM must be set to xterm-256color

To install, run the following from your terminal: (you may want to backup yourexisting ~/.tmux.conf first)

$ cd
$ git clone https://github.com/gpakosz/.tmux.git
$ ln -s -f .tmux/.tmux.conf
$ cp .tmux/.tmux.conf.local .

�� You can clone the repository anywhere you want, provided you create theproper ~/.tmux.conf symlink and you copy the .tmux.conf.local sample file inyour home directory:

$ git clone https://github.com/gpakosz/.tmux.git /path/to/oh-my-tmux
$ ln -s -f /path/to/oh-my-tmux/.tmux.conf ~/.tmux.conf
$ cp /path/to/oh-my-tmux/.tmux.conf.local ~/.tmux.conf.local

Then proceed to customize your ~/.tmux.conf.local copy.

If you're a Vim user, setting the $EDITOR environment variable to vim willenable and further customize the vi-style key bindings (see tmux manual).

If you're new to tmux, I recommend you read tmux 2: Productive Mouse-FreeDevelopment by @bphogan.

Troubleshooting

  • I'm running tmux HEAD and things don't work properly. What should I do?

    Please open an issue describing what doesn't work with upcoming tmux. I'll domy best to address it.

  • Status line is broken and/or gets duplicated at the bottom of the screen.What gives?

    This particularly happens on Linux when the distribution provides a versionof glib that received Unicode 9.0 upgrades (glib >= 2.50.1) while providinga version of glibc that didn't (glibc < 2.26). You may also configureLC_CTYPE to use an UTF-8 locale. Typically VTE based terminal emulatorsrely on glib's g_unichar_iswide() function while tmux relies on glibc'swcwidth() function. When these two functions disagree, display gets messedup.

    This can also happen on macOS when using iTerm2 and "Use Unicode version 9character widths" is enabled in Preferences... > Profiles > Text

    For that reason, the default ~/.tmux.conf.local file stopped using Unicodecharacters for which width changed in between Unicode 8.0 and 9.0 standards,as well as Emojis.

  • I installed Powerline and/or (patched) fonts but can't see Powerlinesymbols.

    First, you don't need to install Powerline. You only need fonts patched withPowerline symbols or the standalone PowerlineSymbols.otf font. Then makesure your ~/.tmux.conf.local copy uses the right code points fortmux_conf_theme_left_separator_XXX values.

  • I'm using Bash On Windows (WSL), colors and Powerline look are broken.

    There is currently a bug in the new console powering Bash On Windowspreventing text attributes (bold, underscore, ...) to combine properly withcolors. The workaround is to search your ~/.tmux.conf.local copy andreplace attributes with 'none'.

    Also, until Window's console replaces its GDI based render with a DirectWriteone, Powerline symbols will be broken.

    The alternative is to use the Mintty terminal for WSL.

Features

  • C-a acts as secondary prefix, while keeping default C-b prefix
  • visual theme inspired by Powerline
  • maximize any pane to a new window with <prefix> +
  • SSH/Mosh aware username and hostname status line information
  • mouse mode toggle with <prefix> m
  • automatic usage of reattach-to-user-namespaceif available
  • laptop battery status line information
  • uptime status line information
  • optional highlight of focused pane
  • configurable new windows and panes behavior (optionally retain current path)
  • SSH/Mosh aware split pane (reconnects to remote server)
  • copy to OS clipboard (needs reattach-to-user-namespaceon macOS, xsel or xclip on Linux)
  • support for 4-digit hexadecimal Unicode characters
  • Facebook PathPicker integration if available
  • Urlview integration if available

The "maximize any pane to a new window with <prefix> +" feature is differentfrom builtin resize-pane -Z as it allows you to further split a maximizedpane. It's also more flexible by allowing you to maximize a pane to a newwindow, then change window, then go back and the pane is still in maximizedstate in its own window. You can then minimize a pane by using <prefix> +either from the source window or the maximized window.

Maximize pane

Mouse mode allows you to set the active window, set the active pane, resizepanes and automatically switches to copy-mode to select text.

Mouse mode

Bindings

tmux may be controlled from an attached client by using a key combination of aprefix key, followed by a command key. This configuration uses C-a as asecondary prefix while keeping C-b as the default prefix. In the followinglist of key bindings:

  • <prefix> means you have to either hit Ctrl + a or Ctrl + b
  • <prefix> c means you have to hit Ctrl + a or Ctrl + b followed by c
  • <prefix> C-c means you have to hit Ctrl + a or Ctrl + b followed by Ctrl + c

This configuration uses the following bindings:

  • <prefix> e opens ~/.tmux.conf.local with the editor defined by the$EDITOR environment variable (defaults to vim when empty)

  • <prefix> r reloads the configuration

  • C-l clears both the screen and the tmux history

  • <prefix> C-c creates a new session

  • <prefix> C-f lets you switch to another session by name

  • <prefix> C-h and <prefix> C-l let you navigate windows (default<prefix> n and <prefix> p are unbound)

  • <prefix> Tab brings you to the last active window

  • <prefix> - splits the current pane vertically

  • <prefix> _ splits the current pane horizontally

  • <prefix> h, <prefix> j, <prefix> k and <prefix> l let you navigatepanes ala Vim

  • <prefix> H, <prefix> J, <prefix> K, <prefix> L let you resize panes

  • <prefix> < and <prefix> > let you swap panes

  • <prefix> + maximizes the current pane to a new window

  • <prefix> m toggles mouse mode on or off

  • <prefix> U launches Urlview (if available)

  • <prefix> F launches Facebook PathPicker (if available)

  • <prefix> Enter enters copy-mode

  • <prefix> b lists the paste-buffers

  • <prefix> p pastes from the top paste-buffer

  • <prefix> P lets you choose the paste-buffer to paste from

Additionally, copy-mode-vi matches my own Vim configuration

Bindings for copy-mode-vi:

  • v begins selection / visual mode
  • C-v toggles between blockwise visual mode and visual mode
  • H jumps to the start of line
  • L jumps to the end of line
  • y copies the selection to the top paste-buffer
  • Escape cancels the current operation

Configuration

While this configuration tries to bring sane default settings, you may want tocustomize it further to your needs. Instead of altering the ~/.tmux.conf fileand diverging from upstream, the proper way is to edit the ~/.tmux.conf.localfile.

Please refer to the sample .tmux.conf.local file to know more about variablesyou can adjust to alter different behaviors. Pressing <prefix> e will open~/.tmux.conf.local with the editor defined by the $EDITOR environmentvariable (defaults to vim when empty).

Enabling the Powerline look

Powerline originated as a status-line plugin for Vim. Its popular eye-catchinglook is based on the use of special symbols: Powerline Symbols

To make use of these symbols, there are several options:

Please see the Powerline manual for further details.

Then edit your ~/.tmux.conf.local copy (with <prefix> e) and adjust thefollowing variables:

tmux_conf_theme_left_separator_main='\uE0B0'
tmux_conf_theme_left_separator_sub='\uE0B1'
tmux_conf_theme_right_separator_main='\uE0B2'
tmux_conf_theme_right_separator_sub='\uE0B3'

Configuring the status line

Contrary to the first iterations of this configuration, by now you have totalcontrol on the content and order of status-left and status-right.

Edit your ~/.tmux.conf.local copy (<prefix> e) and adjust thetmux_conf_theme_status_left and tmux_conf_theme_status_right variables toyour own preferences.

This configuration supports the following builtin variables:

  • #{battery_bar}: horizontal battery charge bar
  • #{battery_percentage}: battery percentage
  • #{battery_status}: is battery charging or discharging?
  • #{battery_vbar}: vertical battery charge bar
  • #{circled_session_name}: circled session number, up to 20
  • #{hostname}: SSH/Mosh aware hostname information
  • #{hostname_ssh}: SSH/Mosh aware hostname information, blank when notconnected to a remote server through SSH/Mosh
  • #{loadavg}: load average
  • #{pairing}: is session attached to more than one client?
  • #{prefix}: is prefix being depressed?
  • #{root}: is current user root?
  • #{synchronized}: are the panes synchronized?
  • #{uptime_y}: uptime years
  • #{uptime_d}: uptime days, modulo 365 when #{uptime_y} is used
  • #{uptime_h}: uptime hours
  • #{uptime_m}: uptime minutes
  • #{uptime_s}: uptime seconds
  • #{username}: SSH/Mosh aware username information
  • #{username_ssh}: SSH aware username information, blank when not connectedto a remote server through SSH/Mosh

Beside custom variables mentioned above, the tmux_conf_theme_status_left andtmux_conf_theme_status_right variables support usual tmux syntax, e.g. using#() to call an external command that inserts weather information provided bywttr.in:

tmux_conf_theme_status_right='#{prefix}#{pairing}#{synchronized} #(curl -m 1 wttr.in?format=3 2>/dev/null; sleep 900) , %R , %d %b | #{username}#{root} | #{hostname} '

The sleep 900 call makes sure the network request is issued at most every 15minutes whatever the value of status-interval.

Weather information from wttr.in

�� You can also define your own custom variables. See the sample.tmux.conf.local file for instructions.

Finally, remember tmux_conf_theme_status_left andtmux_conf_theme_status_right end up being given to tmux as status-left andstatus-right which means they're passed through strftime(). As such, the %character has a special meaning and needs to be escaped by doubling it, e.g.

tmux_conf_theme_status_right='#(echo foo %% bar)'

See man 3 strftime.

Using TPM plugins

This configuration now comes with built-in TPM support:

  • use the set -g @plugin ... syntax to enable a plugin
  • whenever a plugin introduces a variable to be used in status-left orstatus-right, you can use it in tmux_conf_theme_status_left andtmux_conf_theme_status_right variables, see instructions above ��
  • ⚠️ do not add set -g @plugin 'tmux-plugins/tpm'
  • ⚠️ do not add run '~/.tmux/plugins/tpm/tpm' to ~/.tmux.conf or your
  • ~/.tmux.conf.local copy ← people who are used to alter.tmux.conf to add TPM support will have to adapt their configuration

⚠️ The TPM bindings differ slightly from upstream:

  • installing plugins: <prefix> + I
  • uninstalling plugins: <prefix> + Alt + u
  • updating plugins: <prefix> + u

See ~/.tmux.conf.local for instructions.

Accessing the macOS clipboard from within tmux sessions (tmux < 2.6)

Chris Johnsen created the reattach-to-user-namespaceutility that makes pbcopy and pbpaste workagain within tmux.

To install reattach-to-user-namespace, use either MacPorts orHomebrew:

$ port install tmux-pasteboard

or

$ brew install reattach-to-user-namespace

Once installed, reattach-to-usernamespace will be automatically detected.

Using the configuration under Cygwin within Mintty

I don't recommend running this configuration with Cygwin anymore. Forkingunder Cygwin is extremely slow and this configuration issues a lot ofrun-shell commands under the hood. As such, you will experience high CPUusage. As an alternative consider using Mintty terminal for WSL.

cygwin

It is possible to use this configuration under Cygwin within Mintty, howeversupport for Unicode symbols and emojis lacks behind Mac and Linux.

Particularly, Mintty's text rendering is implemented with GDI which haslimitations:

  • color emojis are only available through DirectWrite starting with Windows 8.1
  • display of double width symbols, like the battery discharging symbol indicator(U+1F50B) is buggy

To get Unicode symbols displayed properly, you have to use font linking.Open regedit.exe then navigate to the registry key atHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLinkand add a new entry for you preferred font to link it with the Segoe UI Symbolfont.

regedit

  • 1. tmux定义 tmux(terminal multiplexer)称为终端复用器,它可以启动一系列会话。 它的存在使得我们运行的服务或者执行的一些命令被保留,而不用关闭终端窗口后再打开或者重新输入命令执行。 它解绑了会话和终端窗口。使得关闭终端窗口再打开,会话并不会终止,而是继续运行。 简单来说就可以分屏,允许断开Terminal连接后,继续运行进程。 2. tmux安装 我这里以cento

  • /********************************************************************** * tmux不自动加载配置文件.tmux.conf * 说明: * 使用SSH连接服务器,只有一个窗口,使用起来比较麻烦,于是使用tmux来分屏, * 结果写了tmux的配置,一直无效,原来是需要手动加载,尤

  • tmux配置文件 1.编辑.tmux.conf文件输入以下内容,请勿直接粘贴复制(有坑,有可能导致配置失败),使用vim编辑以下内容: unbind C-b set -g prefix C-s setw -g mode-keys vi set -g base-index 1 set-option -g mouse on bind-key k select-pane -U bind-key j se

  •  cat ~/.tmux.conf ################ GENERAL ################                                                                                                   [6/56] set -g default-terminal "xterm-256c

  • 更 好 的 阅 读 体 验 \textcolor{red}{更好的阅读体验} 更好的阅读体验 2.1 Tmux 简介 功能: 分屏操作 允许断开Terminal连接后,继续运行进程。 结构: 一个tmux可以包含多个session,一个session可以包含多个window,一个window可以包含多个pane。 实例: tmux: session

  • # # author : # modified : # #-- base settings --# set -g default-terminal "xterm-256color" set -g display-time 3000 set -g escape-time 0 set -g history-limit 65535 set -g base-index 1 set -g pane-

  • Linux终端复用神器-Tmux使用梳理 Tmux是一个优秀的终端复用软件,类似GNU Screen,但来自于OpenBSD,采用BSD授权。使用它最直观的好处就是,通过一个终端登录远程主机并运行tmux后, 在其中可以开启多个控制台而无需再“浪费”多余的终端来连接这台远程主机;是BSD实现的Screen替代品,相对于Screen,它更加先进:支持屏幕切分, 而且具备丰富的命令行参数,使其可以灵活

  • tmux学习资料很多,但是配置方法很少,我这里补个bug 第一种网上配置 https://github.com/gpakosz/.tmux sudo apt-get install tmux git clone https://github.com/gpakosz/.tmux.git ln -s -f .tmux/.tmux.conf cp .tmux/.tmux.conf.local . su

  • 近期因为误操作重新安装了系统,顺便重新修改了一下自己的.tmux.conf文件,特地记录如下 set -g default-terminal "screen-256color" set -g history-limit 65535 # change prefix to ctrl+a set -g prefix ^a unbind ^b # select pane like vim bind k

  • 美化配置: #tmux >= 2.3 tmux -V #update:check bottom url cd git clone https://github.com/gpakosz/.tmux.git ln -s -f .tmux/.tmux.conf cp .tmux/.tmux.conf.local . 敏捷配置: alias dy='tmux -CC -u new-session -s

  • 1、下载zsh配置和tmux配置 wget http://decs.pcl.ac.cn:3731/mirrors/software/Linux/tmux/tmux.tar.gz tar -zxf tmux.tar.gz ls -al tmux -rwxrwxr-x 1 root root 460 Jul 28 2020 tm -rw-r–r-- 1 root root 5901 Sep 3 202

  • 一: tmux介绍 Tmux 是一个终端复用器(terminal multiplexer),非常有用,属于常用的开发工具。 1.1 会话与进程 命令行的典型使用方式是,打开一个终端窗口(terminal window,以下简称"窗口"),在里面输入命令。用户与计算机的这种临时的交互,称为一次"会话"(session) 。 会话的一个重要特点是,窗口与其中启动的进程是连在一起的。打开窗口,会话开始;

  • 原文:https://blog.csdn.net/chenqiuge1984/article/details/80132042 --------------------------------------------------- 导读 我一直信奉简洁至上的原则,桌面窗口的数量越少,我的心情就越愉悦,开发的效率也就越高。反之,杂乱的桌面,暴涨的Chrome tab数量,或是无数的终端窗口,它们会逐

  • 概述 趁手的工具能大大提高生产力。而对于整天与 Linux 字符终端打交道的程序员来说,终端工具、shell 工具以及文本编辑工具,一定要用好、用趁手。这里 3 个工具我选择的分别是 tmux、bash、Vim。当然,*NIX(UNIX、Linux)环境下还有很大其他很好的选择,如 screen、zsh、Emacs 等等,关键还是自己用趁手。没有最好,只有最合适自己的。不要盲目站队、打口水仗。一切

  • 查看tmux当前版本: tmux -V 编辑tmux配置文件 : vim ~/.tmux.conf tmux2.1(含2.1)之后版本: set-option -g mouse on tmux2.1之前版本: setw -g mouse-resize-pane on setw -g mouse-select-pane on setw -g mouse-select-window on setw -

  • 记录一下自己的.tmux.conf,.vimrc ~/.tmux.conf set -g default-terminal "screen-256color" set -g prefix C-a bind C-a send-prefix unbind C-b bind r source-file ~/.tmux.conf \; display "Reloaded!" set -g base-ind

  • 一、概述 Tmux 是一个终端复用器(terminal multiplexer),非常有用,属于常用的开发工具。 1、会话与进程 https://blog.csdn.net/matafeiyanll/article/details/109788874 会话的一个重要特点是,窗口与其中启动的进程是连在一起的。打开窗口,会话开始;关闭窗口,会话结束,会话内部的进程也会随之终止,不管有没有运行完。 一个

  • 安装 brew search tmux brew install tmux tmux -V 解决前缀键的问题 Ctrl+b离的太远了,我们可以改成Ctrl+a 配置的博客 先用vim创建一个~/.tmux.conf的文件并添加如下命令 set -g prefix C-a # unbind C-b # C-b即Ctrl+b键,unbind意味着解除绑定 bind C-a send-prefix #

  • 问题描述 服务器重启后,tmux找不到tmp下面的文件,原有的session无法列出。 error connecting to /tmp/tmux-1001/default (No such file or directory) 彻底彻底彻底的解决办法 以上情况往往是误删除了tmux-xxx导致的,而tmux默认放在/tmp目录 只需要更改tmux-xxx的默认目录即可,如下: export T

  • 概述 tmux 用了很长时间了, 快捷键定制了不少, 唯一的遗憾是没法保存 session, 每次关机重开之后, 恢复不到之前的 tmux session. 虽然也能忍受, 但是每天都手动打开之前的 session, 总觉得有些麻烦, 直到找到了 tmux-resurrect tmux-resurrect 可以方便的保存和恢复 tmux session. 安装 可以直接安装, 也可以通过 tpm

  • What should I do before opening an issue? Before opening an issue, please ensure that: Your problem is a specific problem or question or suggestion, not a general complaint. $TERM inside tmux is scree

  • 尝试tmux -L name1 list-session 。 当我没有任何会话运行时,这发生在我身上。 我刚刚开始使用tmux,并没有意识到,如果你重新启动你的电脑,你会失去你的会议,我首先感到吃惊。 对于那些正在考虑同样的事情的人: 重启后恢复tmux会话 。 post总结:使用shell脚本来构build你的tmux会话或创build一个奇特的shell历史跟踪器 。 TL; DR:尝试将SI

 相关资料
  • 问题内容: 我试图获得一个+ 和+ + 绑定在tmux会话中工作(我也在使用PuTTY)。 我已经经历了必须重新编译PuTTY的痛苦,以便它能够正确发送和发送。使用+之后,我能够看到并分别发送给+ 和+ + 。有什么办法可以将这些绑定到tmux内部的下一个窗口和上一个窗口? 编辑:经过一些研究,我想我可能必须配置xterm来包括那些键码。知道我该怎么做吗? Edit2:所以我发现我可以检索info

  • 遇到一个问题,未在docker容器文件中初始化。此外,人们将附加到一个预先存在的容器上,从而造成搜索障碍。这不是我想要做的。 我试图做的是运行两个“应用程序”,它们需要同时相互对话。这个想法是为了避免使用docker compose来解决这个特殊问题。 我可以轻松地将这两个命令作为后台进程运行。 但是,我宁愿让它们在一个tmux会话中运行,当图像运行时,我可以附加到该会话。 在构建过程中,如何在d

  • 我最近安装了Zsh,希望有更好的生活和更美好的早晨。然而,我很快意识到Zsh与tmux结合引入了各种问题。 第一个问题是在我的命令之前,在提示符的末尾发生了一些奇怪的事情,但是通过为tmux提供用于unicode支持的-u标志解决了这个问题。但是,我遇到了最后一个问题,在我将Zsh与tmux一起使用之前需要解决: Usecase:自动完成包含多个建议的命令 问题:自动完成将建议向右移动一个字符,同

  • 我在远程机器上使用Jupyter笔记本,通过ssh-l8000:localhost:8888登录 但是:我无法关闭ssh连接。键入退出不会关闭它(只是让我等待),如果我通过ctrl-c强制退出,浏览器中的笔记本将失去与远程计算机的连接。 我是不是搞错了?或者我确实需要建立ssh连接,以便浏览器中的笔记本保持连接?

  • 我正在使用macOS BigSur。我使用ssh隧道在远程机器上的gpu上运行脚本。由于进程很长,我正在使用,我希望在断开与的连接时,进程继续运行。但问题是,当ssh断开时,

  • 我可以在本地运行tmux并通过ssh连接到远程机器吗。。在这之后,任何新的窗格和/或屏幕将与远程机器外壳。。。我想说的是,我不能在远程机器上安装tmux,但我不想从每个窗格进行ssh连接,只想ssh登录一次。 这样的事可能发生吗。。谢谢

  • 介绍 说明:tmux is a "terminal multiplexer", it enables a number of terminals (or windows) to be accessed and controlled from a single terminal. tmux is intended to be a simple, modern, BSD-licensed altern

  • session tmux # 创建新的 session tmux new -S name # 创建新的 session 并指定一个name tmux ls # 查看多少个后台工作的 session tmux a/at/attach # 重新连接 session tmux a/at/attach -t num # 如果有多个 session, 指定 session num 连接 tmux

相关阅读

相关文章

相关问答

相关文档