tmux set -g:命令不工作

tmux set -g : command not working

我的 .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

你被告知要执行的 "source ~/tmux.conf" 是一个 tmux 命令,而不是 bash 一个。您应该将其输入 Prefix : 提示

您不应该在 shell 中获取它,而是告诉 tmux 获取它。

run tmux source ~/.tmux.conf