diff options
Diffstat (limited to 'usr.bin/tmux/cmd-bind-key.c')
-rw-r--r-- | usr.bin/tmux/cmd-bind-key.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-bind-key.c b/usr.bin/tmux/cmd-bind-key.c index a7de6097b77..3171c7eed53 100644 --- a/usr.bin/tmux/cmd-bind-key.c +++ b/usr.bin/tmux/cmd-bind-key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-bind-key.c,v 1.8 2010/01/23 17:50:56 nicm Exp $ */ +/* $OpenBSD: cmd-bind-key.c,v 1.9 2010/06/26 18:20:53 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -130,7 +130,7 @@ cmd_bind_key_exec(struct cmd *self, unused struct cmd_ctx *ctx) return (cmd_bind_key_table(self, ctx)); key_bindings_add(data->key, data->can_repeat, data->cmdlist); - data->cmdlist = NULL; /* avoid free */ + data->cmdlist->references++; return (0); } @@ -192,8 +192,17 @@ cmd_bind_key_print(struct cmd *self, char *buf, size_t len) off += xsnprintf(buf, len, "%s", self->entry->name); if (data == NULL) return (off); + + if (off < len && data->command_key) + off += xsnprintf(buf + off, len - off, " -c"); + if (off < len && !(data->key & KEYC_PREFIX)) + off += xsnprintf(buf + off, len - off, " -n"); + if (off < len && data->can_repeat) + off += xsnprintf(buf + off, len - off, " -r"); + if (off < len && data->tablename != NULL) + off += cmd_prarg(buf + off, len - off, " -t ", data->tablename); if (off < len) { - skey = key_string_lookup_key(data->key); + skey = key_string_lookup_key(data->key & ~KEYC_PREFIX); off += xsnprintf(buf + off, len - off, " %s ", skey); } if (off < len) |