Discussion:
Can't bind multiple commands with bind -t
Jan Larres
2013-11-15 01:29:40 UTC
Permalink
Hi,

In principle it is possible to bind multiple commands to one key like
this:

bind-key r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"

But if the -t option is given this does not work:

$ tmux bind-key -t vi-copy Escape cancel \\\; display "foo"
not enough arguments

The problem is that in cmd-bind-key.c in the -t case the arguments are
checked like this:

if (args->argc != 2 && args->argc != 3) {

That should probably be

if (args->argc < 3) {

instead.

Cheers,
Jan
Nicholas Marriott
2013-11-15 07:10:02 UTC
Permalink
You can't bind multiple commands to keys in modes. One key to one command.

-------- Original message --------
From: Jan Larres <***@majutsushi.net>
Date: 15/11/2013 02:29 (GMT+01:00)
To: tmux-***@lists.sourceforge.net
Subject: Can't bind multiple commands with bind -t

Hi,

In principle it is possible to bind multiple commands to one key like
this:

  bind-key r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"

But if the -t option is given this does not work:

  $ tmux bind-key -t vi-copy Escape cancel \\\; display "foo"
  not enough arguments

The problem is that in cmd-bind-key.c in the -t case the arguments are
checked like this:

  if (args->argc != 2 && args->argc != 3) {

That should probably be

  if (args->argc < 3) {

instead.

Cheers,
Jan

Loading...