[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tmux uses ^? for backspace
From: |
Nicholas Marriott |
Subject: |
Re: tmux uses ^? for backspace |
Date: |
Tue, 22 Sep 2020 10:37:32 +0100 |
Hi
OpenBSD consistently configures all backspace to ^? including tmux,
xterm, etc. By default, tmux will always generate ^?.
I think FreeBSD still uses ^H, and I think they patch tmux to send ^H as
well.
It may be sensible to change kbs but I don't know if it will make much
difference - like you say, I think most programs accept a combination.
On Mon, Sep 21, 2020 at 06:52:08PM -0400, Thomas Dickey wrote:
> 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