diff options
Diffstat (limited to 'input-keys.c')
-rw-r--r-- | input-keys.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/input-keys.c b/input-keys.c index 9e47a553..b0ea5104 100644 --- a/input-keys.c +++ b/input-keys.c @@ -42,9 +42,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 }, @@ -159,7 +156,7 @@ input_key(struct window_pane *wp, key_code key, struct mouse_event *m) u_int i; size_t dlen; char *out; - key_code justkey; + key_code justkey, newkey; struct utf8_data ud; log_debug("writing key 0x%llx (%s) to %%%u", key, @@ -179,6 +176,14 @@ input_key(struct window_pane *wp, key_code key, struct mouse_event *m) return; } + /* Is this backspace? */ + if ((key & KEYC_MASK_KEY) == KEYC_BSPACE) { + newkey = options_get_number(global_options, "backspace"); + if (newkey >= 0x7f) + newkey = '\177'; + key = newkey|(key & KEYC_MASK_MOD); + } + /* * 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. |