RE: nano hangs when pasting five characters
"Doug Smythies" <[email protected]>
| Newsgroups | gmane.editors.nano.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Benno, I am switching back to the email thread for this one, because it likely is of interest only, and would just be noise on the bug report thread. I wrote a simple program to capture keystrokes and the time between each so that I could measure the time between characters for pastes. Two graphs are attached for 93,298 paste buffers done with WIN32-OPenSSH and PuTTY. Summary (which we kind of already know): Sometimes the WIN version has huge gaps in time on the 16 character boundaries, but PuTTY does not. The huge delays are: 16 1 21562 37 80 5 23970 31 160 10 4702 31 176 11 4672 37 93296 5831 22429 38 <- the ASCII character | | |__ time in uSec since the previous character got to the program | |__ buffer number = character number / 16 to be able to check if boundary (Yes) |__ Character number in paste buffer ... Doug -----Original Message----- From: Benno Schulenberg <[email protected]> Sent: March 1, 2025 3:44 AM To: Doug Smythies <[email protected]>; [email protected] Subject: Re: nano hangs when pasting five characters Hello Doug, Op 01-03-2025 om 01:47 schreef Doug Smythies: > + if (input == ERR) { > + napms(20); /* check for sender slower than here */ > + input = wgetch(frame); /* check again */ > + if (input == ERR) > + break; > + } > But it turns out that it works fine if the sleep is 29 mSec instead of 20. > 28 mSec and below doesn't work. 29 mSec and above works. Interesting. The other modification (with the 2 ms delay for each byte) resulted in a 32 ms delay for the entire paste minus the final tilde, which is also just enough to see the tilde. Anyway, I have re-reported this issue on Savannah [1] and have attached a workaround. Are you okay with its form? [1] https://savannah.gnu.org/bugs/?66858 Benno
character-times.png
(image/png, 18.4 KB) - not displayed
character-times-detail-a.png
(image/png, 39.6 KB) - not displayed