bugGNU nano - Bugs: bug #48388, when the user starts typing during...

 
 

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

bug #48388: when the user starts typing during loading, a byte is dropped

Submitter:  Benno Schulenberg <bens>
Submitted:  Sun 03 Jul 2016 11:35:04 AM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Mon 04 Jul 2016 09:43:38 AM UTC, comment #2: 

The dropping is fixed in git, 29986e9.

For the misrecognizing of "M-G 11", see bug #48395.

Benno Schulenberg <bens>
Group administrator
Sun 03 Jul 2016 12:40:58 PM UTC, comment #1: 

The offending commit is 31f0456.  That'll teach me: not to do a move and a change at the same time.  But still: it's a mystery to me how the old version does not lose a byte.  Hmmm...  Maybe because it looks at the keyboard only after (on average) a second and a half have passed, and precalculation doesn't take that long even on a hundred thousand lines, and thus it never gets anything from the keyboard buffer at all?  My version looks at the keyboard immediately -- which is kind of proper, because for the syntaxes that we have, loading a large file takes longer than precalculating the multiline data for it.  So when the precalculation starts, already a "long" time has passed, and if the user is impatient, the precalculation should be skipped entirely.

(But when we put back the byte, we get the problem that David mentioned: the keyboard buffer then holds "^[ g 1 1" and the keyboard code tries to interpret that as a single sequence instead of as three.  Which is strange, because the only known escape sequences start with either "Esc O", "Esc o", "Esc [" or "Esc Esc".  So when it sees "Esc g", it shouldn't even consider anything after it as part of the sequence.  Sure, that will enter unwanted characters into the text when nano is used on a terminal that produces real unknown sequences, but that is good, that will get us bug reports, instead of just beeping at the user with "Unknown sequence" and we never hear anything.)

Benno Schulenberg <bens>
Group administrator
Sun 03 Jul 2016 11:35:04 AM UTC, original submission:  

To reproduce, open a huge file with nano: 'src/nano hundredthousand.c', and while it loads, immediately type M-G 11.
When the file has been loaded and is displayed, the string "g11" has been added to the buffer.  The Alt modifier (^[) apparently has been dropped.

Bug is present since nano-2.5.1.  In nano-2.5.0 and before, typing M-G 11 during loading will (when the file gets displayed) result in a beep plus the message "Unknown Command".  Not very nice either, but better than adding something unexpected and unwanted to the file.

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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-07-30 bens Open/ClosedOpen Closed
    2016-07-04 bens StatusIn Progress Fixed
    2016-07-03 bens StatusNone In Progress

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code