Search code examples
tmux

tmux set -g : command not working


My .tmux.conf looks like this:

#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"

I am sourcing it using `source ~/.tmux.conf' and it gives me error messages. I am just trying to setup an easy option for copy and paste. Why isn't it identifying the set -g option?

-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

Solution

  • The "source ~/tmux.conf" you were presumably told to execute is a tmux command, not a bash one. You're supposed to type it into the Prefix : prompt