GNU nano - Bugs: bug #64996, nano hangs when 39 characters are...
You are not allowed to post comments on this tracker with your current authentication level.
bug #64996: nano hangs when 39 characters are pasted in a VScode terminal
Submitter: | Jacob Lifshay <programmerjake> | ||
Submitted: | Thu 07 Dec 2023 11:03:58 PM UTC | ||
Severity: | 4 - Important | Status: | Fixed |
Assigned to: | bens | Open/Closed: | Open |
Jump to the original submission
Thu 21 Dec 2023 02:48:00 PM UTC, comment #13: |
Benno Schulenberg <bens> |
Thu 21 Dec 2023 09:59:13 AM UTC, comment #12:
yes, there's an extra tilde left over.
|
Jacob Lifshay <programmerjake> |
Thu 21 Dec 2023 09:45:07 AM UTC, comment #11:
|
Benno Schulenberg <bens> |
Tue 19 Dec 2023 01:18:15 AM UTC, comment #10:
|
Jacob Lifshay <programmerjake> |
Fri 15 Dec 2023 11:07:51 AM UTC, comment #9: Attached patch should avoid the hang and should consume the "spurious" trailing tilde. Can you check whether this works?
|
Benno Schulenberg <bens> |
Tue 12 Dec 2023 05:48:58 PM UTC, comment #8: vscode is apparently going to add a workaround where they try to avoid splitting escape sequences across multiple writes:
|
Jacob Lifshay <programmerjake> |
Tue 12 Dec 2023 04:58:35 PM UTC, comment #7: Hmm. When VScode always splits pastes into chunks of at most 50 bytes, then it's strange that nano receives pastes of 40 or 41 or 42 or 43 characters in one bunch. All I can think of is that somehow ncurses notices that "1b 5b 32 30" is an incomplete escape sequence and waits for more to arrive, but does not notice that "1b 5b 32 30 31" is incomplete. (Or maybe VScode sends a chunk quicker when it's more than one byte? Just quick enough for ncurses to weld the chunks together.)
|
Benno Schulenberg <bens> |
Tue 12 Dec 2023 06:34:03 AM UTC, comment #6: apparently splitting writes into 50-byte chunks is intentional:
|
Jacob Lifshay <programmerjake> |
Tue 12 Dec 2023 04:05:08 AM UTC, comment #5:
|
Jacob Lifshay <programmerjake> |
Tue 12 Dec 2023 03:01:58 AM UTC, comment #4: It seems as though vscode just likes being weird when pasting 39-character strings...
|
Jacob Lifshay <programmerjake> |
Sat 09 Dec 2023 11:34:24 AM UTC, comment #3: It seems that the VScode terminal sends at most 50 bytes in one go, which means that for a 39-character paste it chops the closing sequence of the bracketed paste into "\e [ 2 0 1" (in the first 50 bytes) and "~" (arriving in the next batch). But nano expects to receive escape sequences in their entirety. This is a deficiency in nano's keyboard handling, but would be difficult to fix.
|
Benno Schulenberg <bens> |
Fri 08 Dec 2023 10:08:29 PM UTC, comment #2: I tested with nano-7.2 (I had to manually git pull --unshallow in gnulib for it to see the commit it wanted...)
|
Jacob Lifshay <programmerjake> |
Fri 08 Dec 2023 11:05:11 AM UTC, comment #1: In the linked issue, nano-4.8 is used. Does the problem also occur when using the latest nano-7.2?
|
Benno Schulenberg <bens> |
Thu 07 Dec 2023 11:03:58 PM UTC, original submission:
issue on vscode's issue tracker: https://github.com/microsoft/vscode/issues/180257
|
Jacob Lifshay <programmerjake> |
Depends on the following items: None found
Items that depend on this one: None found
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 14 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2024-01-23 | bens | Severity | 3 - Normal | 4 - Important | |
Summary | VScode terminal hangs when pasting 39 characters into nano | nano hangs when 39 characters are pasted in a VScode terminal | |||
2023-12-21 | bens | Summary | VScode terminal hangs when pasting 39-characters into nano | VScode terminal hangs when pasting 39 characters into nano | |
2023-12-21 | bens | Status | Need Info | Fixed | |
Assigned to | None | bens | |||
2023-12-15 | bens | Attached File | - | Added 0001-input-avoid-hanging-after-a-39-character-paste-on-a-.patch, #55454 | |
2023-12-12 | bens | Attached File | - | Added avoid-hanging-on-certain-pastes.patch, #55439 | |
2023-12-12 | programmerjake | Attached File | - | Added dump-term-input.py, #55436 | |
Attached File | - | Added keystrokes.txt, #55437 | |||
2023-12-12 | programmerjake | Attached File | - | Added TRAIL40, #55434 | |
Attached File | - | Added TRAIL43, #55435 | |||
2023-12-08 | programmerjake | Attached File | - | Added TRAIL, #55422 | |
2023-12-08 | bens | Status | None | Need Info | |
Summary | vscode terminal appears to crash when pasting 39-characters into nano | VScode terminal hangs when pasting 39-characters into nano |
Powered by Savane 3.13-02a9.
Corresponding source code
Thanks for the feedback. The mitigation has been pushed to git, commit 4a915b1e. It avoids the hang by understanding any invalid escape sequence that starts with \e[2 as a truncated end-of-paste marker.
(Marked as "Fixed" because Savannah does not know "Worked-around".)