diff options
author | nicm <nicm> | 2019-11-14 07:55:01 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-11-14 07:55:01 +0000 |
commit | 08b07b1a08ad02f7a195437deead0a60f971e1ee (patch) | |
tree | 008cb66149cd8540af544c6f73d4094d096dc18b /input-keys.c | |
parent | c225262e132ded1b4e1e8c0bd21884e9da78ddb3 (diff) | |
download | rtmux-08b07b1a08ad02f7a195437deead0a60f971e1ee.tar.gz rtmux-08b07b1a08ad02f7a195437deead0a60f971e1ee.tar.bz2 rtmux-08b07b1a08ad02f7a195437deead0a60f971e1ee.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 'input-keys.c')
-rw-r--r-- | input-keys.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/input-keys.c b/input-keys.c index 6e521ae1..1325e813 100644 --- a/input-keys.c +++ b/input-keys.c @@ -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. |