tmux set -g:命令不起作用

时间:2015-11-13 02:32:39

标签: tmux

我的.tmux.conf看起来像这样:

#remap default "prefix" from Ctrl-b to Ctrl-a
set -g prefix C-a


# mouse options for selecting pane
set -g mode-mouse on
set -g mouse resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on

# Use vim keybindings in copy mode
setw -g mode-keys vi

# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"

# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"

我使用`source~ / .tmux.conf'来源它。它给了我错误信息。我只是想设置一个简单的复制和粘贴选项。为什么它不识别set -g选项?

-bash: set: -g: invalid option
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
-bash: set: -g: invalid option
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
-bash: set: -g: invalid option
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
-bash: set: -g: invalid option
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
-bash: set: -g: invalid option
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
-bash: setw: command not found
-bash: bind-key: command not found
-bash: bind-key: command not found
-bash: unbind: command not found
-bash: bind-key: command not found

2 个答案:

答案 0 :(得分:5)

你可能被告知要执行的“source~ / tmux.conf”是一个tmux命令,而不是一个bash命令。你应该把它输入前缀 提示

答案 1 :(得分:2)

你不应该在你的shell中获取它,而是告诉tmux来源它。

run tmux source ~/.tmux.conf