bugGNU nano - Bugs: bug #58909, M-V followed by M-Bsp does not...

 
 

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

bug #58909: M-V followed by M-Bsp does not enter anything

Submitter:  Benno Schulenberg <bens>
Submitted:  Fri 07 Aug 2020 05:43:16 AM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Sat 08 Aug 2020 05:58:10 AM UTC, comment #4: 

Fixed in git, commit 5fab1e67.

On my machine (and with Xfce Terminal), pausing one millisecond is enough to get M-V M-Bsp to enter "^[^?" every time, but I've been generous and made it pause twenty milliseconds.  The delay is nearly impercetible.

Benno Schulenberg <bens>
Group administrator
Sat 08 Aug 2020 05:38:53 AM UTC, comment #3: 

The problem of M-V M-Bsp sometimes seeming to enter nothing does not occur on xterm and rxvt.  Apparently those emulators are fast enough to get stuff into ncurses' hands before nano calls wgetch() in non-blocking mode.  But Xfce Terminal is just a bit too slow, getting it wrong about two thirds of the time.  Probably other VTE-based emulators are too slow too, so... we need to add a little pause.

Benno Schulenberg <bens>
Group administrator
Fri 07 Aug 2020 05:45:13 PM UTC, comment #2: 

Ehm...  It's not fully fixed.  On the first few tries (M-V M-Bsp M-V M-Bsp M-V M-Bsp) they all entered "^[^?" into the buffer.  But now, trying it again, it seems to do nothing as many times as it succeeds.  :|

The problem is that after getting the ESC from ncurses, we may do the second call of wgetch() (now in nodelay mode) too quickly: too soon for the character after the escape code to have arrived from the keyboard.

In other words: when we get an ESC, we have to pause a little, to give the keyboard routines the time to get their stuff into the hands of ncurses.  Pausing will never be perfect: when the system is under stress, the pause may be too short.  But at least now we are too fast roughly half of the time.  We need to wait a little.

Benno Schulenberg <bens>
Group administrator
Fri 07 Aug 2020 02:28:18 PM UTC, comment #1: 

Fixed in git, commit cdd68825, by taking in as verbatim the first two keycodes (when there is more than one and the first is ESC).

As implied in the commit message, the user should wait for visual feedback after typing M-V followed by <Esc>, because otherwise the keystroke after <Esc> could be inserted verbatim too (or could be misinterpreted if it is double-escape sequence).

Benno Schulenberg <bens>
Group administrator
Fri 07 Aug 2020 05:43:16 AM UTC, original submission:  

To reproduce, run 'src/nano --ignore' and type: M-V M-Bsp.
Nothing seems to have entered into the buffer, but it is marked as Modified.  Now type: M-U.  The escape character (^[) gets restored into the buffer.

Expected behavior: M-V followed by M-Bsp should enter the sequence "^[^?" into the buffer (the ESC code plus whatever code the Backspace key produces).

Benno Schulenberg <bens>
Group administrator

 

(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 (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-08-13 bens Open/ClosedOpen Closed
    2020-08-08 bens StatusIn Progress Fixed
    2020-08-07 bens StatusFixed In Progress
    2020-08-07 bens StatusNone Fixed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code