bugGNU nano - Bugs: bug #48459, Esc followed by a Ctrl+letter...

 
 

bug #48459: Esc followed by a Ctrl+letter reports an unbound key

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Sun 10 Jul 2016 07:54:57 PM UTC  
 
Severity: 3 - NormalStatus: Fixed
Assigned to: Benno Schulenberg <bens>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 13 Jul 2016 08:14:12 AM UTC, comment #2:

Fixed in git, f2150d3.

(For Ctrl+Alt+key it says "Unbound key". It should probably say "Unbindable key" because nano does not respond to any Ctrl+Alt combination, nor does the keybinding code allow the combination of M- and ^.)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Mon 11 Jul 2016 08:12:11 AM UTC, comment #1:

The offending commit is cd59a64: "Not treating the holding of both Control and Meta the same as only Control."

Hmmm. On the one hand I don't want Ctrl+Alt+key to do the same as just Ctrl+key, but on the other hand I do want <Esc> followed by Ctrl+key to do the same as just Ctrl+key. For the movement keys (and Ins and Del) this is possible, because they produce different sequences when Alt (or Ctrl or Shift) is held, so they can be distinguished from the sequences that are just prefixed with Esc. But for the letter keys (and Tab and Enter and Backspace) this isn't possible: the sequence produced by Ctrl+Alt+letter is exactly the same as Esc followed by Ctrl+letter.

If only the terminal would return an Esc pressed by itself immediately, then we could see that ^[ and ^X arrive separately...

Oh -- apparently ncurses knows a variable called ESCDELAY... The default value is a 1000 ms. If nano would set it to say 50 ms, we could easily distinguish between single keystroke Ctrl+Alt+G and an Esc followed by Ctrl+G.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sun 10 Jul 2016 07:54:57 PM UTC, original submission:

To reproduce, run 'src/nano' and type: <Esc> Ctrl+G. Instead of showing the help screen, it reports on the statusbar: "Unbound key: M-^G".

This worked fine before version 2.3.5. And it should again. Attached patch fixes it for me.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 30 Jul 2016 09:24:18 AM UTCbensOpen/ClosedOpen=>Closed
    Wed 13 Jul 2016 08:14:12 AM UTCbensStatusIn Progress=>Fixed
    Sun 10 Jul 2016 07:54:57 PM UTCbensAttached File-=>Added controlcodes-are-not-meta.patch, #37793

    Back to the top


    Powered by Savane 3.1-cleanup1