pg2455
pg2455

Reputation: 5178

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

Upvotes: 4

Views: 7362

Answers (3)

user8318650
user8318650

Reputation: 71

You are not supposed to source it within your shell, but rather tell tmux to source it. Run the following in your terminal:

tmux source ~/.tmux.conf

Upvotes: 7

Hari
Hari

Reputation: 1815

Just tmux source ~/.tmux.conf from the command line also works.

Upvotes: 0

Random832
Random832

Reputation: 39090

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

Upvotes: 9

Related Questions