summaryrefslogtreecommitdiffstats
path: root/spawn.c
diff options
context:
space:
mode:
authornicm <nicm>2019-11-14 07:55:01 +0000
committernicm <nicm>2019-11-14 07:55:01 +0000
commit08b07b1a08ad02f7a195437deead0a60f971e1ee (patch)
tree008cb66149cd8540af544c6f73d4094d096dc18b /spawn.c
parentc225262e132ded1b4e1e8c0bd21884e9da78ddb3 (diff)
Add an option to set the key sent by backspace for those whose system
uses ^H rather than ^?. GitHub issue 1969.
Diffstat (limited to 'spawn.c')
-rw-r--r--spawn.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/spawn.c b/spawn.c
index d74e55f3..dfa39ad7 100644
--- a/spawn.c
+++ b/spawn.c
@@ -217,6 +217,7 @@ spawn_pane(struct spawn_context *sc, char **cause)
u_int hlimit;
struct winsize ws;
sigset_t set, oldset;
+ key_code key;
spawn_log(__func__, sc);
@@ -378,13 +379,17 @@ spawn_pane(struct spawn_context *sc, char **cause)
/*
* Update terminal escape characters from the session if available and
- * force VERASE to tmux's \177.
+ * force VERASE to tmux's backspace.
*/
if (tcgetattr(STDIN_FILENO, &now) != 0)
_exit(1);
if (s->tio != NULL)
memcpy(now.c_cc, s->tio->c_cc, sizeof now.c_cc);
- now.c_cc[VERASE] = '\177';
+ key = options_get_number(global_options, "backspace");
+ if (key >= 0x7f)
+ now.c_cc[VERASE] = '\177';
+ else
+ now.c_cc[VERASE] = key;
if (tcsetattr(STDIN_FILENO, TCSANOW, &now) != 0)
_exit(1);