Bug 434776 - Backspace doesn't send characters based on the current terminfo entry
Summary: Backspace doesn't send characters based on the current terminfo entry
Status: REPORTED
Alias: None
Product: konsole
Classification: Applications
Component: keyboard (show other bugs)
Version: 20.08.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-22 16:45 UTC by Mark Manning
Modified: 2021-03-24 18:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Manning 2021-03-22 16:45:03 UTC
SUMMARY

kitting a backspace in konsole returns a 0x7f character
infocmp shows kbs=^H, which is a 0x08

STEPS TO REPRODUCE
1. hit the backspace
2. obeserve the valur returned
3. scratch head

OBSERVED RESULT
hitting backspace returns 0x7f

EXPECTED RESULT
expected backspace to return 0x08 as specified in the terminfo file
or for the terminfo file to specify 0x7f which is what the terminal
actually returns

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Ahmad Samir 2021-03-22 17:29:01 UTC
Please check which key binding scheme is selected in "Edit current profile"->Keyboard, "Default" should give the behaviour you want, i.e. Backspace sends \x7f.
Comment 2 Mark Manning 2021-03-22 17:31:01 UTC
thats the INCORRECT response
the CORRECT response is for the backspace key to return exactly what terminfo says the backspace key will return.  Either terminfo for konsole needs to be changed or konsole needs to be changed.  Per terminfo the correct return value for a backspace key is 0x08 or control H not 0x7f
Comment 3 Ahmad Samir 2021-03-22 17:50:48 UTC
infocmp on my system shows:
#       Reconstructed via infocmp from file: /usr/share/terminfo/x/xterm-256color
xterm-256color|xterm with 256 colors,

and:
kbs=^?



Ctrl+V then Backspace shows '^?'
Ctrl+V then Ctrl+Backspace shows '^H'
in Konsole, XTerm, and Gnome-terminal.
Comment 4 Mark Manning 2021-03-22 18:21:43 UTC
infocmp -1 in Konsole
Reconstructed via infocmp from file: /etc/terminfo/x/xterm-256color
       kbs=^H,
Comment 5 Mark Manning 2021-03-22 18:23:04 UTC
control v + backspace also returns ^? which is contrary to what terminfo says
Comment 6 Mark Manning 2021-03-22 18:26:13 UTC
xterm returns values in line with what is specified in the terminfo file here, it returns ^H for backspace
Comment 7 Ahmad Samir 2021-03-23 12:29:06 UTC
I would say this is by design, the details are explained in https://invent.kde.org/utilities/konsole/-/blob/master/doc/user/README.keyboard

so Konsole doesn't follow the terminfo in this case, but offers an editor to let the user change it easily.
Comment 8 Mark Manning 2021-03-23 13:47:29 UTC
Oooh so when a USER writes an application using my text user interface github.com/mark4th/uCurses , that application is going to FAIL in konsole because it wont be able to recognize a backspace on every konsole it is run in.

yes ****I*** can change MY instance of konsole to perform with CORRECT behavior but me fixing MY konsole does not fix everyone elses.

Konsole has incorrect behavior, its not me that needs to fix it :/