Re: Unexpected behaviour of Backspace when binding ^H

Benno Schulenberg <[email protected]> Fri, 10 Apr 2020 17:28:02 +0200
Newsgroups gmane.editors.nano.general
Message-ID <[email protected]>
Op 10-04-2020 om 12:07 schreef Ciprian Tomoiaga:
> Yes, I am now running 4.9.
> It is behaving like you described: Ctrl+H and Backspace are equivalent when
> running `nano` and they both do 'backspace', regardless of the binding of ^H.
> However, running `nano -K` behaves correctly, namely ^H replaces and backspace
> erases.

Okay, I'm glad that the rebinding of ^H works now for you.

But that you need to use -K to get it to work means that your terminal
emulator does not set the TERM environment variable correctly.

> As for running without mouse support, that's OK, I never used mouse to
> click somewhere. And scrolling the mouse still moves the cursor in nano, so
> that's great.

That the scroll wheel (or a two-fingered move on a touchpad) causes the
cursor to move is something that ncurses does, I think.  If nano detects
such a roll, it will scroll the screen three rows at a time.

> It seems the Sakura emulator is correct, this is what I'm getting:
> infocmp| grep -o kbs=..
> kbs=^H

This alone says nothing.  You have to compare it with what gets shown when
you type at the prompt: ^V <Backspace> (or inside nano: M-V <Backspace>).
When those two are the same, the terminal is configured correctly (well,
at least for the backspace key).

> So, is this a bug that I should file with iTerm2 ?

I don't know.  Again, you have to compare the output of:
  infocmp | grep -o kbs=..
with the output of:
  ^V <Backspace>

If they differ, iTerm2 does not set the TERM variable correctly.


On my Xfce terminal:
$ infocmp | grep -o kbs=..
kbs=^?
$ ^?  (<== this is the result of typing ^V <Backspace>)

They are the same, so my terminal is configured properly.


By the way, you will want to update nano to 4.9.2.  :)

Benno
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEv9AJBh5TUFKtDfIVDSjU0qCs6IQFAl6QkIIACgkQDSjU0qCs
6IRSEA//XcicCTAmo9yaJydJC92lA7kt4jPNw1vml8i/6BwXbG7qTi0SrmPc8uxN
ReJrO+0bGg9q5BRF8qfNNEjC784o7bWVxtAq1iSIqJ+Ihx9odvZBQKXuO2/q6and
7tGFeVzA4ZhoPw8b+P8GIVQ0kJeKYmaOt9sDAG+nDl5xqYEc9wrGODQnjbnDJyoL
96mEkddc0UsE0VqJ99XLCjTNn+j/JOt99+SIX8TYUZfSksC3wh9/cfLFrMyONnvE
ofpw47oAQ/+sCSBAxh9aeyWx/kG/RKxGs5q/vtgdvGGtaXmbgjU+3YG3/T107+Qv
euR6XaiWYQzrLYQ6uibrm7Wb8ke6IUh2vab1pfQqaUgGss2+M/9xoxPWga4x83yI
dpnzo2TzlkSEJ0HiiESLk+heqDmCzwuUPbNhWe6sigs6NybyHvEiVt9Ad9AGk6WI
nabxIMfqjdE9PpdlGX+tPTX5sJ8VvPOCMpKW2T7sF9J+iqpjljqmZRHRjiXRv7zw
oKFIOFHj1ZXcaaYEoy3o81WtcHD8rA18HuQWEUwzNDjbiIWA/kVbRMDv4UE9UOXe
NxZbf2uFCnKdDAOecfMqlZL4XPeH6xQTvLbq+u1EMmJjtLQM/tHyqHtyHR/VuWlD
fRp68VJZweo6DSoj1xC6Z8xUywkeGbmt0ssL+BRYgh9Rvy990zU=
=8fvA
-----END PGP SIGNATURE-----