diff options
author | 2019-11-14 07:55:01 +0000 | |
---|---|---|
committer | 2019-11-14 07:55:01 +0000 | |
commit | fdd8dc918b0bd5a01daff43667799980fe8d1042 (patch) | |
tree | f5be25d05815113d705573ae59213c1505620a8f /usr.bin/tmux/input-keys.c | |
parent | avoid a use after free in if_delgroup. (diff) | |
download | wireguard-openbsd-fdd8dc918b0bd5a01daff43667799980fe8d1042.tar.xz wireguard-openbsd-fdd8dc918b0bd5a01daff43667799980fe8d1042.zip |
Add an option to set the key sent by backspace for those whose system
uses ^H rather than ^?. GitHub issue 1969.
Diffstat (limited to 'usr.bin/tmux/input-keys.c')
-rw-r--r-- | usr.bin/tmux/input-keys.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/tmux/input-keys.c b/usr.bin/tmux/input-keys.c index e59854f4490..79f8246441b 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.64 2019/07/09 14:03:12 nicm Exp $ */ +/* $OpenBSD: input-keys.c,v 1.65 2019/11/14 07:55:01 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -43,9 +43,6 @@ struct input_key_ent { }; static const struct input_key_ent input_keys[] = { - /* Backspace key. */ - { KEYC_BSPACE, "\177", 0 }, - /* Paste keys. */ { KEYC_PASTE_START, "\033[200~", 0 }, { KEYC_PASTE_END, "\033[201~", 0 }, @@ -180,6 +177,13 @@ input_key(struct window_pane *wp, key_code key, struct mouse_event *m) return; } + /* Is this backspace? */ + if ((key & KEYC_MASK_KEY) == KEYC_BSPACE) { + key = options_get_number(global_options, "backspace"); + if (key >= 0x7f) + key = '\177'; + } + /* * If this is a normal 7-bit key, just send it, with a leading escape * if necessary. If it is a UTF-8 key, split it and send it. |