【问题标题】:Tmux won't read ~/.tmux.confTmux 不会读取 ~/.tmux.conf
【发布时间】:2015-04-24 09:10:19
【问题描述】:

我正在通过 SSH 在另一台机器上运行 tmux 会话。我的~/.tmux.conf 如下:

# set Ctrl-a as the default prefix key combination
# and unbind C-b to free it up
set prefix C-a
unbind-key C-b

如您所见,没有什么花哨的。通过使用killall tmuxtmux kill-server,我确保没有剩余的tmux 会话正在运行。当启动一个新的 tmux 会话时,前缀似乎是C-b,所以我最好的猜测是我的 conf 没有加载。当使用C-b + :source-file ~/.tmux.conf 时,我的前缀变为C-a。通过 yum 安装 tmux,不能用 yum 更新更高版本。

$ tmux -V
tmux 1.6

发生了什么事?

【问题讨论】:

  • 不是编程问题。请申请迁移到 superuser.com。
  • 你说的很对,很抱歉。标记它。

标签: tmux


【解决方案1】:

首先,您必须确保.tmux.conf 位于您的远程计算机$HOME,而不是您本地的$HOME

在文件中,你可以试试这个(评论中的解释):

unbind C-b  
set -g prefix C-a # change prefix key to Ctrl-a as global opt, same as gnu screen
bind a send-prefix #send ^A, so that you can press ctrl-a a to send ctrl-a

顺便说一句,你可以在没有root权限的情况下编译和安装新的tmux给你的本地用户。

【讨论】:

  • 哇!那成功了,将我的配置更改为上述解决了我的问题!非常感谢!
【解决方案2】:

因为您忘记了在配置结束时绑定发送前缀。添加以下行,它会工作:)

bind-key C-a send-prefix

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-11-01
    • 1970-01-01
    • 2019-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多