diff options
author | 2009-10-26 17:46:33 +0000 | |
---|---|---|
committer | 2009-10-26 17:46:33 +0000 | |
commit | bbf9de78822cd195f98a48794b61c8a00be1caee (patch) | |
tree | c381c2222d9bfc79cba1abe11e4038c9e3540373 /usr.bin/tmux/input-keys.c | |
parent | Replace pool_get() + bzero() with pool_get(..., PR_ZERO). (diff) | |
download | wireguard-openbsd-bbf9de78822cd195f98a48794b61c8a00be1caee.tar.xz wireguard-openbsd-bbf9de78822cd195f98a48794b61c8a00be1caee.zip |
Rewrite xterm-keys code (both input and output) so that works (doesn't always
output the same modifiers, accepts all the possible input keys) and is more
understandable.
Diffstat (limited to 'usr.bin/tmux/input-keys.c')
-rw-r--r-- | usr.bin/tmux/input-keys.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.bin/tmux/input-keys.c b/usr.bin/tmux/input-keys.c index 365a0d126a0..c382752fa5b 100644 --- a/usr.bin/tmux/input-keys.c +++ b/usr.bin/tmux/input-keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input-keys.c,v 1.11 2009/10/26 14:30:57 nicm Exp $ */ +/* $OpenBSD: input-keys.c,v 1.12 2009/10/26 17:46:33 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -174,6 +174,18 @@ input_key(struct window_pane *wp, int key) return; } + /* + * Then try to look this up as an xterm key, if the flag to output them + * is set. + */ + if (options_get_number(&wp->window->options, "xterm-keys")) { + if ((out = xterm_keys_lookup(key)) != NULL) { + buffer_write(wp->out, out, strlen(out)); + xfree(out); + return; + } + } + /* Otherwise look the key up in the table. */ for (i = 0; i < nitems(input_keys); i++) { ike = &input_keys[i]; |