bugGNU nano - Bugs: bug #56994, ^H cannot be rebound on some...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #56994: ^H cannot be rebound on some terminals

Submitter:  Tiago Almeida <tjapro>
Submitted:  Fri 04 Oct 2019 11:28:31 PM UTC
   
 
Severity:  3 - Normal Status:  Invalid
Assigned to:  None Open/Closed:  Closed

Jump to the original submission

Wed 16 Oct 2019 08:23:14 AM UTC, comment #6: 

(Oops -- I shouldn't close this one until the doc update has been released.)

Benno Schulenberg <bens>
Group administrator
Mon 07 Oct 2019 11:38:48 AM UTC, comment #5: 

I've added a note to the documentation saying that on some terminals it's impossible to rebind ^H.

  https://git.savannah.gnu.org/cgit/nano.git/commit/?id=e90b40e6

(I would mark this issue as "Not A Bug", but Savannah doesn't know that status.)

Benno Schulenberg <bens>
Group administrator
Sun 06 Oct 2019 01:57:14 PM UTC, comment #4: 

Thanks!
I've comment this issue: https://github.com/termux/termux-app/issues/212#issuecomment-538749582
Waiting for response.

Tiago Almeida <tjapro>
Sun 06 Oct 2019 10:17:48 AM UTC, comment #3: 

The kbs=^H shows that your Backspace key produces a literal ^H (0x08) and thus ncurses translates this to the KEY_BACKSPACE code.  Thus typing an actual Ctrl+H also gets translated to KEY_BACKSPACE by ncurses.  Nano never sees the 0x08, so this code cannot be rebound.

However, you can switch off the translation by ncurses with --raw (--rawsequences).  Then you should be able to rebind ^H.  But that also means you lose the Backspace key, which is probably far worse than not being able to rebind the ^H keystroke.

Maybe you can convince Termux to use a different code for the Backspace key by fiddling with the TERM environment variable.  But don't be surprised when that breaks everything else.

Benno Schulenberg <bens>
Group administrator
Sat 05 Oct 2019 02:32:29 PM UTC, comment #2: 

I'm in an android tablet with termux.

System information:
Linux localhost 3.18.22+ #1 SMP PREEMPT Fri Jan 26 10:43:21 CET 2018 aarch64 Android
Termux-packages arch:
aarch64
Android version:
6.0

$ infocmp | grep kbs
        kNXT=\E[6;2~, kPRV=\E[5;2~, kRIT=\E[1;2C, kb2=\EOE, kbs=^H,

$ infocmp | grep "\^H"
csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
        kNXT=\E[6;2~, kPRV=\E[5;2~, kRIT=\E[1;2C, kb2=\EOE, kbs=^H,

Tiago Almeida <tjapro>
Sat 05 Oct 2019 10:17:13 AM UTC, comment #1: 

For me, 'bind ^H help all' works fine.  When I put that in my ~/.nanorc, and then run nano, ^H opens the help viewer.

What terminal are you using?  It seems that your ^H keystroke produces KEY_BACKSPACE (0x0107) and not the plain ^H control code (0x08).  What distro are you on?

What is the output of 'infocmp | grep kbs'?

And the output of 'infocmp | grep "\^H"'?

Benno Schulenberg <bens>
Group administrator
Fri 04 Oct 2019 11:28:31 PM UTC, original submission:  

Let me explain:
- bind ^H help all
- try open help: doesn't open, instead the shortcut continues binded to backspace (but the backspace or delete keys works fine).


nano --version
 GNU nano, version 4.4
 (C) 1999-2011, 2013-2019 Free Software Foundation, Inc.
 (C) 2014-2019 the contributors to nano
 Email: nano@nano-editor.org    Web: https://nano-editor.org/
 Compiled options: --disable-libmagic --disable-nls --enable-utf8

Tiago Almeida <tjapro>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by tjapro (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-11-30 bens Open/ClosedOpen Closed
    2019-10-16 bens Open/ClosedClosed Open
    2019-10-16 bens Open/ClosedOpen Closed
    2019-10-07 bens StatusNone Invalid
    2019-10-06 bens Summary'bind ^H help all' does not seem to work on some terminals ^H cannot be rebound on some terminals
    2019-10-05 bens SummaryBind ^H turns in a bug 'bind ^H help all' does not seem to work on some terminals

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code