summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-unbind-key.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-12-12 18:19:00 +0000
committernicm <nicm@openbsd.org>2015-12-12 18:19:00 +0000
commit0bd9fd8f2d4f4289ee483c71331058cc126d71aa (patch)
tree9ae5e6c75ba58ca271fce73b7dc54991e2feb713 /usr.bin/tmux/cmd-unbind-key.c
parentcorrect comment (diff)
downloadwireguard-openbsd-0bd9fd8f2d4f4289ee483c71331058cc126d71aa.tar.xz
wireguard-openbsd-0bd9fd8f2d4f4289ee483c71331058cc126d71aa.zip
Allow prefix and prefix2 to be set to None to disable (useful if you
would rather bind the prefix in the root table).
Diffstat (limited to 'usr.bin/tmux/cmd-unbind-key.c')
-rw-r--r--usr.bin/tmux/cmd-unbind-key.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/tmux/cmd-unbind-key.c b/usr.bin/tmux/cmd-unbind-key.c
index 02ddee2fde7..5cbe6750a34 100644
--- a/usr.bin/tmux/cmd-unbind-key.c
+++ b/usr.bin/tmux/cmd-unbind-key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-unbind-key.c,v 1.22 2015/11/12 11:05:34 nicm Exp $ */
+/* $OpenBSD: cmd-unbind-key.c,v 1.23 2015/12/12 18:19:00 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -51,7 +51,7 @@ cmd_unbind_key_exec(struct cmd *self, struct cmd_q *cmdq)
return (CMD_RETURN_ERROR);
}
key = key_string_lookup_string(args->argv[0]);
- if (key == KEYC_NONE) {
+ if (key == KEYC_NONE || key == KEYC_UNKNOWN) {
cmdq_error(cmdq, "unknown key: %s", args->argv[0]);
return (CMD_RETURN_ERROR);
}
@@ -60,13 +60,13 @@ cmd_unbind_key_exec(struct cmd *self, struct cmd_q *cmdq)
cmdq_error(cmdq, "key given with -a");
return (CMD_RETURN_ERROR);
}
- key = KEYC_NONE;
+ key = KEYC_UNKNOWN;
}
if (args_has(args, 't'))
return (cmd_unbind_key_mode_table(self, cmdq, key));
- if (key == KEYC_NONE) {
+ if (key == KEYC_UNKNOWN) {
tablename = args_get(args, 'T');
if (tablename == NULL) {
key_bindings_remove_table("root");
@@ -109,7 +109,7 @@ cmd_unbind_key_mode_table(struct cmd *self, struct cmd_q *cmdq, key_code key)
return (CMD_RETURN_ERROR);
}
- if (key == KEYC_NONE) {
+ if (key == KEYC_UNKNOWN) {
while (!RB_EMPTY(mtab->tree)) {
mbind = RB_ROOT(mtab->tree);
RB_REMOVE(mode_key_tree, mtab->tree, mbind);