After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 733246 - Ctrl+Backspace should send ^H
Ctrl+Backspace should send ^H
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.37.x
Other Linux
: Normal minor
: ---
Assigned To: VTE Maintainers
VTE Maintainers
: 420039 752540 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-07-16 12:57 UTC by Egmont Koblinger
Modified: 2015-08-16 10:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix (679 bytes, patch)
2015-04-13 09:12 UTC, Egmont Koblinger
committed Details | Review

Description Egmont Koblinger 2014-07-16 12:57:26 UTC
In xterm, Backspace sends ^? whereas Ctrl+Backspace sends ^H.
In vte, both send ^?.

I guess it's subject to XTerm resources, g-t's compability (stty erase etc.) settings, and probably in case of XTerm it also depends on terminfo's kbs which AFAICT is patched by Ubuntu (or by Redhat?) from ^H to ^? or the other way around, I can't remember exactly.
Comment 1 Christian Persch 2014-08-16 18:02:10 UTC
I guess now that we only support xterm emulation, we should also offer exactly the (and only the) delete/backspace settings that xterm offers. So this whole delete/backspace binding stuff needs revising.
Comment 2 Egmont Koblinger 2014-08-16 18:28:36 UTC
It's customizable in xterm, and I think distros / non-Linux Unixes are likely to configure these to match their stty settings.
Comment 3 Jan Niklas Hasse (Account disabled) 2015-04-12 21:01:41 UTC
Any news on this? I would really like to see this fixed, where would I start if I want to help?
Comment 4 Egmont Koblinger 2015-04-12 22:03:31 UTC
The code is in vte's src/vte.c vte_terminal_key_press() case GDK_KEY_BackSpace... See a couple of lines below at case GDK_KEY_Insert for how to check for modifiers.

The tricky part is to check what xterm does for each of the possible backspace bindings (^H, ^?, anything else???) and make sure vte does the same in all cases. It's a great chance to do some cleanup (as per comment 1) and remove the options (if any) that we support but xterm doesn't.
Comment 5 Jan Niklas Hasse (Account disabled) 2015-04-12 22:28:02 UTC
With different options you mean the possible enum values of terminal->pvt->backspace_binding?

Does xterm support any options for this? After googling I found that xterm always sends ASCII backspace, is this correct?
Comment 6 Egmont Koblinger 2015-04-12 22:33:09 UTC
(In reply to Jan Niklas Hasse from comment #5)
> With different options you mean the possible enum values of
> terminal->pvt->backspace_binding?

Exactly. Along with different values of "stty erase", if/whenever relevant.

> Does xterm support any options for this? After googling I found that xterm
> always sends ASCII backspace, is this correct?

The backarrowKey, backarrowKeyIsErase, ptyInitialErase settings seem to be relevant. (Er... did you mean the backspace key without modifier, or with Ctrl?) We'd need to investigate to understand the situation much better.

Thanks in advance if you're willing to contribute to this! :)
Comment 7 Egmont Koblinger 2015-04-13 09:12:20 UTC
Created attachment 301445 [details] [review]
Fix

xterm seems to toggle the Backspace key's behavior between ^H and ^? when Ctrl is pressed. I've added this toggling feature.

For the Delete key, it can emit ^? or an escape sequence, but Ctrl is ignored here, ^? remains ^?.

We have more options for the Delete, e.g. it can generate ^H which might not ever be needed, dunno. Seems our code aims for feature parity between the two keys, yet the code that implements them differs. Not sure if it makes more sense to go for complete parity (and make Delete also toggle on Ctrl), or go for xterm-like approach and drop some of the features. Or probably just leave it as is for now :)
Comment 8 Jan Niklas Hasse (Account disabled) 2015-04-14 19:45:59 UTC
Cool, this is all I need, thanks!

I couldn't get gnome-terminal's master branch to compile on my machine to test it, but I can't wait when this hits distributions (so 2017 I guess :D)
Comment 9 Egmont Koblinger 2015-04-14 20:48:31 UTC
2016 is a better bet :)
Comment 10 Egmont Koblinger 2015-05-03 20:31:51 UTC
*** Bug 420039 has been marked as a duplicate of this bug. ***
Comment 11 Tobias Getzner 2015-06-15 15:10:17 UTC
Thanks for that patch, working nicely here.
Comment 12 Egmont Koblinger 2015-07-18 10:11:56 UTC
*** Bug 752540 has been marked as a duplicate of this bug. ***
Comment 13 Egmont Koblinger 2015-08-16 10:26:01 UTC
Fixed