为什么 tmux 源不起作用?未知命令

为什么 tmux 源不起作用?未知命令

我该如何解决这个问题?这是我收到的代码和输出。这是 tmux 2.3 和 debian 8.9。

root@ns540540:/# tmux source ~/.tmux.conf
/root/.tmux.conf:1: unknown command: @plugin
/root/.tmux.conf:2: unknown command: assume-paste-time
/root/.tmux.conf:3: unknown command: base-index
/root/.tmux.conf:4: unknown command: bell-action
/root/.tmux.conf:5: unknown command: bell-on-alert
/root/.tmux.conf:6: unknown command: default-command
/root/.tmux.conf:7: unknown command: default-shell
/root/.tmux.conf:8: unknown command: destroy-unattached
/root/.tmux.conf:9: unknown command: detach-on-destroy
/root/.tmux.conf:10: unknown command: display-panes-active-colour
/root/.tmux.conf:11: unknown command: display-panes-colour
/root/.tmux.conf:12: unknown command: display-panes-time
/root/.tmux.conf:13: unknown command: display-time
/root/.tmux.conf:14: unknown command: history-limit
/root/.tmux.conf:15: unknown command: key-table
/root/.tmux.conf:16: unknown command: lock-after-time
/root/.tmux.conf:17: unknown command: lock-command
/root/.tmux.conf:18: unknown command: message-command-style
/root/.tmux.conf:19: unknown command: message-style
/root/.tmux.conf:20: unknown command: mouse
/root/.tmux.conf:21: unknown command: prefix
/root/.tmux.conf:22: unknown command: prefix2
/root/.tmux.conf:23: unknown command: renumber-windows
/root/.tmux.conf:24: unknown command: repeat-time
/root/.tmux.conf:25: unknown command: set-remain-on-exit
/root/.tmux.conf:26: unknown command: set-titles
/root/.tmux.conf:27: unknown command: set-titles-string
/root/.tmux.conf:28: unknown command: status
/root/.tmux.conf:29: unknown command: status-interval
/root/.tmux.conf:30: unknown command: status-justify
/root/.tmux.conf:31: unknown command: status-keys
/root/.tmux.conf:32: unknown command: status-left
/root/.tmux.conf:33: unknown command: status-left-length
/root/.tmux.conf:34: unknown command: status-left-style
/root/.tmux.conf:35: unknown command: status-position
/root/.tmux.conf:36: unknown command: status-right
/root/.tmux.conf:37: unknown command: status-right-length
/root/.tmux.conf:38: unknown command: status-right-style
/root/.tmux.conf:39: unknown command: status-style
/root/.tmux.conf:40: unknown command: update-environment
/root/.tmux.conf:41: unknown command: visual-activity
/root/.tmux.conf:42: unknown command: visual-bell
/root/.tmux.conf:43: unknown command: visual-silence
/root/.tmux.conf:44: unknown command: word-separators

谢谢,麦克斯

答案1

根据tmux手册页~/.tmux.conf是个人配置文件的默认位置tmux,因此当您调用时将自动读取并应用它,tmux而无需以任何方式指定它。如果你想要显式指定配置文件,您可以使用以下-f选项:

$ tmux -f ~/.tmux.conf

教程中给出的命令用于重新加载~/.tmux.conf到已经运行的会话中。它可以执行为

tmux-session$ tmux source-file ~/.tmux.conf

或者输入 tmux escape 命令序列(可配置,但默认情况下为CTRL+ B :),后跟命令source-file ~/.tmux.conf


如果您希望设置应用于所有用户,您可以在 中进行设置/etc/tmux.conf。这将在以下情况下自动读取:任何用户启动tmux

如果您想要应用设置特定用户,将它们放入~/.tmux.conf.当用户启动时,这将被自动读取tmux,并将应用于(覆盖)来自 的任何全局首选项/etc/tmux.conf

您不应该作为普通用户进行采购/root/.tmux.conf。如果您希望此用户具有与之前配置的设置相同的设置root,请将其设置为全局设置,或将其复制/root/.tmux.conf~/.tmux.conf,以便该用户拥有她的个人的配置的副本tmux

相关内容