misc/tmux (and the tmux in base) both force the VERASE character to be
DELETE, instead of leaving it alone at the user's preference. It even
forcefully changes backspace into DELETE, breaking all my terminal
settings.
For decades I have set backspace ^H as the erase character, and forced
my keyboards to produce the backspace character from the key which is
clearly marked backspace.
Tmux seems to think it knows my preferences better than me and forces
its own ideas upon me. My systems are consistent and tmux messes it up.
So I have local patches to fix it: it leaves the VERASE setting alone,
so it stays the way you like it. It also doesn't translate keys into DEL
any more.
If you like DEL as your erase character, there is of course no change
from the patch, as you will have set your terminals accordingly already.
I want to add these patches to pkgsrc. I would also like to patch the
base system tmux in the same way. Objections?
$NetBSD$
Don't mess up the erase character.
--- window.c.orig 2017-05-29 07:12:06.000000000 +0000
+++ window.c
@@ -919,7 +919,9 @@ window_pane_spawn(struct window_pane *wp
fatal("tcgetattr failed");
if (tio != NULL)
memcpy(tio2.c_cc, tio->c_cc, sizeof tio2.c_cc);
+#if 0
tio2.c_cc[VERASE] = '\177';
+#endif
#ifdef IUTF8
tio2.c_iflag |= IUTF8;
#endif
$NetBSD$
Don't mess up the erase character.
--- tty-keys.c.orig 2017-05-16 13:10:11.000000000 +0000
+++ tty-keys.c
@@ -541,7 +541,9 @@ tty_keys_next(struct tty *tty)
struct timeval tv;
const char *buf;
size_t len, size;
+#if 0
cc_t bspace;
+#endif
int delay, expired = 0, n;
key_code key;
@@ -654,6 +656,7 @@ partial_key:
complete_key:
log_debug("%s: complete key %.*s %#llx", c->name, (int)size, buf, key);
+#if 0
/*
* Check for backspace key using termios VERASE - the terminfo
* kbs entry is extremely unreliable, so cannot be safely
@@ -662,6 +665,7 @@ complete_key:
bspace = tty->tio.c_cc[VERASE];
if (bspace != _POSIX_VDISABLE && (key & KEYC_MASK_KEY) == bspace)
key = (key & KEYC_MASK_MOD) | KEYC_BSPACE;
+#endif
/* Remove data from buffer. */
evbuffer_drain(tty->in, size);
-Olaf.
--
Olaf 'Rhialto' Seibert -- rhialto at falu dot nl
___ Anyone who is capable of getting themselves made President should on
\X/ no account be allowed to do the job. --Douglas Adams, "THGTTG"
Attachment:
signature.asc
Description: PGP signature