#3962: Backspace Key doesn't work in pager and Tmux
-----------------------------+-----------------------
Reporter: ManDay | Owner: mutt-dev
Type: defect | Status: new
Priority: major | Milestone:
Component: user interface | Version:
Resolution: | Keywords: BackSpace
-----------------------------+-----------------------
Comment (by kevin8t8):
Thank you for the output to all those commands; that helps a lot. So the
"short answer" is the terminfo entry for screen-256color has a problem.
kbs contains the string the terminal expects to be sent by Backspace.
This would normally be `kbs=\177` (which is `^?` or DEL). Indeed \177 is
what is being sent when you type Backspace. But if you look in the output
of infocmp, you'll see `kbs=^H`.
So ncurses, which reads the terminfo entry, is not returning the
{{{KEY_BACKSPACE}}} keycode to mutt when you press backspace, because it
thinks backspace is `^H`. The entry on my system is `kbs=\177` which
explains why I couldn't reproduce the issue.
I took another look at the ncmpcpp source. I'm not a C++ programmer, but
it looks like it is not relying on ncurses to do keycode translation, as I
originally thought. It seems to be doing its own translation at a pretty
low level, handling some of the common terminal sequences for xterm,
eterm, rxvt, etc.
It also hardcodes the Backspace keycode to 127 (\177 or `^?`). So that's
why it is working for you.
So what does this mean for you. Well, first it may be worth filing a bug
with your distro. If you are comfortable compiling terminfo entries, you
could even try fixing and reinstalling the terminfo entry yourself.
A more practical short-term solution would be what you originally did:
{{{
bind pager \177 previous-line
}}}
From my side, I think it may be worth automatically translating \177 to
KEY_BACKSPACE. If getch() returns the raw value it means it's not bound
to anything in the terminfo file, so this is probably safe. We're frozen
for the 1.9 release right now, but I will poll the other developers about
the idea and unless I get pushback will commit something when develop
opens up again after the release.
--
Ticket URL: <https://dev.mutt.org/trac/ticket/3962#comment:7>
Mutt <http://www.mutt.org/>
The Mutt mail user agent