-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keyboard backspace key sends DEL #212
Comments
I ran into an issue while trying to use efte full-screen editor in Termux, where the editor works properly with either me manually hitting Ctrl-H, or works on my PC in xterm. The editor itself is open source, so someone helped me with creating a patch to have it work with 0x7f as Termux sends. I also agree that having an option to choose what Termux sends over to the programs when the Android backspace key is pressed. |
Hello! I was going to open a new issue, when I saw this one. |
@TJProgrammer -- your issue sounds related but isn't really. When you run In reality, on termux, the backspace key actually sends DEL (0x7F)! So $TERM is somewhat wrong. My termux shell shows $TERM = xterm-256color. Looking at the definition of xterm-256color on a desktop Linux system, it has kbs=\177 (DEL, 0x7f). So it looks, in fact, like termux ships with a slightly modified terminfo entry which is actually wrong. None of this relates directly to my issue. Your issue is that If On the other hand, this is fixing it in the wrong place. The right place is in termux's configuration: either it should not set $TERM equal to 'xterm-256color' (but rather to some terminfo entry whose kbs=\177); or its xterm-256color terminfo entry should have kbs=\177. You can probably fix it yourself by doing something like this (not tested on termux): $ infocmp xterm-256color > myterm.src Now when you run To complete this fix, you would need to add === The
This seems to imply that the author thinks that by changing $TERM (and therefore changing the definition of 'kbs'), you would affect what the terminal keyboard sends when you hit the Backspace key. This is not how it actually works. Terminfo entries are descriptive, not prescriptive: 'kbs' informs software what character is expected to be received when the user hits the Backspace key. It does not instruct the software which operates the keyboard to send that character. It's true that the particular issue can be fixed by changing $TERM. But this is because the descriptive entry in the termux terminfo entry is wrong, not because changing it changes what the keyboard sends. If, in fact, termux did send ^H, you simply would not be able to have ^H bound to 'help'. ^H would already be in use as Backspace; binding something else to it would prevent you from correcting typing errors. === My issue is more or less the inverse. I'm using termux to ssh into a system which strongly prefers ^H to DEL, for the Backspace function. It is an inconvenience to me that the termux keyboard always sends DEL. I would like to be able to configure it to send ^H. Local software inside termux wouldn't be much bothered -- $TERM already claims it's that way, the shell automatically accepts both, and almost all other software is also happy to accept ^H as Backspace. My remote system that I'm ssh'ing into, meanwhile, really doesn't like DEL. I end up having to manually hit Ctrl-H (which, in termux, actually means 'tap the ctrl button on the screen, then h'). It would be far more convenient for me if termux really did send ^H when I tap its on-screen Backspace key. === Historically, about half of all physical terminals sent DEL and half sent ^H. Because both were so widespread, almost all modern terminal emulators have a per-profile setting to control what the Backspace key sends. termux lacks this, which is the bug I raised here and has been languishing for nearly 3 years. It causes me daily pain. |
@ThomasDickey checking in the field, I find some systems have ^H and some have DEL for xterm-256color's kbs. What is the history of that? |
I hope this help. Interesting: according your previous comment I checked the following (and it is according to you):
|
It's well-known to be system-dependent (Unix and BSDs generally use |
Ah, yes,
Anyway, @TJProgrammer's problem can be fixed by changing their active terminfo entry to specify My problem needs a slightly deeper termux change -- a way for me to configure the terminal to actually send ^H for the Backspace key (thus, coincidentally, changing the terminal to match the existing terminfo entry). |
Just for debug:
|
Using Google Keyboard on Android 6. The on-screen symbol is a funky pentagon with 'x', and might actually be an official symbol for 'DEL' in some contexts. Anyway, it is far more convenient for me if it sends ASCII BS 0x08 rather than DEL 0x7f.
This is of course a variable matter between different physical terminals and, these days, emulators. Many emulators have a config setting to choose between (a few will even let you send the Dec VT102 Advanced Mode or Function Mode or whatever it is, complicated ESC [ blahblah sequence, but I'll not ask for that... :)
Please add the setting for 'Backspace key send DEL | BS'. DEL would be the sensible default so as to not break existing users. OR, if the setting already exists, consider this a doc bugreport since I completely failed to find it...
The text was updated successfully, but these errors were encountered: