diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-01-21 08:40:10 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-01-21 08:40:10 +0000 |
commit | 81fb1528cdaec5b3d9d2f1244cf56c5272343b3e (patch) | |
tree | d2db32ed0a0d26ffacbe7c2b3a19b72e665c4cd5 /usr.bin/tmux/cmd-send-prefix.c | |
parent | 90b9a86500506e817f10ec8f397849189239f0b2 (diff) |
Drop the ability to have a list of keys in the prefix in favour of two
separate options, prefix and prefix2. This simplifies the code and gets
rid the data options type which was only used for this one option.
Also add a -2 flag to send-prefix to send the secondary prefix key,
fixing a cause of minor irritation.
People who want three prefix keys are out of luck :-).
Diffstat (limited to 'usr.bin/tmux/cmd-send-prefix.c')
-rw-r--r-- | usr.bin/tmux/cmd-send-prefix.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.bin/tmux/cmd-send-prefix.c b/usr.bin/tmux/cmd-send-prefix.c index 3bf351e6e0f..a99890a47c2 100644 --- a/usr.bin/tmux/cmd-send-prefix.c +++ b/usr.bin/tmux/cmd-send-prefix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-send-prefix.c,v 1.8 2011/01/04 00:42:47 nicm Exp $ */ +/* $OpenBSD: cmd-send-prefix.c,v 1.9 2012/01/21 08:40:09 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -28,8 +28,8 @@ int cmd_send_prefix_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_send_prefix_entry = { "send-prefix", NULL, - "t:", 0, 0, - CMD_TARGET_PANE_USAGE, + "2t:", 0, 0, + "[-2] " CMD_TARGET_PANE_USAGE, 0, NULL, NULL, @@ -42,13 +42,16 @@ cmd_send_prefix_exec(struct cmd *self, struct cmd_ctx *ctx) struct args *args = self->args; struct session *s; struct window_pane *wp; - struct keylist *keylist; + int key; if (cmd_find_pane(ctx, args_get(args, 't'), &s, &wp) == NULL) return (-1); - keylist = options_get_data(&s->options, "prefix"); - window_pane_key(wp, s, ARRAY_FIRST(keylist)); + if (args_has(args, '2')) + key = options_get_number(&s->options, "prefix2"); + else + key = options_get_number(&s->options, "prefix"); + window_pane_key(wp, s, key); return (0); } |