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

 
 

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

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

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

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>
Group administrator
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>
Group administrator
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>
Group administrator

 

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

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-07-30 bens Open/ClosedOpen Closed
    2016-07-13 bens StatusIn Progress Fixed
    2016-07-10 bens Attached File- Added controlcodes-are-not-meta.patch, #37793

    Back to the top

    Powered by Savane 3.13-aa77.
    Corresponding source code