[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tmux uses ^? for backspace
From: |
Thomas Dickey |
Subject: |
Re: tmux uses ^? for backspace |
Date: |
Mon, 21 Sep 2020 18:52:08 -0400 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Mon, Sep 21, 2020 at 09:06:12PM +0200, Přemysl Eric Janouch wrote:
> Hi,
>
> I've noticed that tmux's kbs/key_backspace entry is inherited from
> "screen", which lists it as ^H, however the default in tmux is \177/^?, see:
generally agreeing that it wouldn't hurt (much) to make kbs=^?
However, keep in mind that tmux is a BSD application (OpenBSD),
which makes the stty erase default to ^H (so changing this
would move the problem around -- perhaps not an improvement).
> https://github.com/tmux/tmux/blob/655134f77c927f248f180a7f65c658359e10516e/options-table.c#L184
> https://github.com/tmux/tmux/blob/a5f99e14c6f264e568b860692b89d11f5298a3f2/CHANGES#L382
That's from this commit:
commit 08b07b1a08ad02f7a195437deead0a60f971e1ee
Author: nicm <nicm>
Date: Thu Nov 14 07:55:01 2019 +0000
Add an option to set the key sent by backspace for those whose system
uses ^H rather than ^?. GitHub issue 1969.
which refers to
https://github.com/tmux/tmux/issues/1969
"Leave VERASE setting at the user's preference"
tmux doesn't actually use kbs, as noted in tty-keys.c:
/*
* Check for backspace key using termios VERASE - the terminfo
* kbs entry is extremely unreliable, so cannot be safely
* used. termios should have a better idea.
*/
bspace = tty->tio.c_cc[VERASE];
if (bspace != _POSIX_VDISABLE && (key & KEYC_MASK_KEY) == bspace)
key = (key & KEYC_MASK_MODIFIERS)|KEYC_BSPACE;
(n)curses has something similar with the erasechar/erasewchar functions.
But most applications (I think) use some combination of tests for
KEY_BACKSPACE
KEY_DC
'\b'
'\177'
--
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: PGP signature