nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 38c8845b0539336e45137275cdeac591cdd4ad2a
parent 934d122dd442523f1357f598d8bd0d292edacdc5
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu,  6 Mar 2025 09:25:05 +0100

input: remove a special-case workaround

Let the more general flaw handling (added in commit 41c1b962, and
amended in the previous commit) handle also this case: it's better
to let the user know that they are using poor pasting software than
to silently work around the issue.

This effectively reverts commit 555a9878 from last week.

Diffstat:
Msrc/winio.c | 25+++++--------------------
1 file changed, 5 insertions(+), 20 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -724,30 +724,15 @@ int convert_CSI_sequence(const int *seq, size_t length, int *consumed) /* Esc [ 2 n ; 2 ~ == F21...F24 on some terminals. */ *consumed = 5; #ifndef NANO_TINY - else { + else if (length > 3 && seq[1] == '0' && seq[3] == '~') { /* Esc [ 2 0 0 ~ == start of a bracketed paste, * Esc [ 2 0 1 ~ == end of a bracketed paste. */ - int trailer = 0; - - if (length > 3 && seq[1] == '0' && seq[3] == '~') { - trailer = '~'; - *consumed = 4; - } else if (length == 3 && seq[1] == '0') { - /* Wait at most one second for the missing '~' character. */ - halfdelay(10); - disable_kb_interrupt(); - trailer = getch(); - *consumed = 3; - raw(); - } - - if (trailer != '~') { - *consumed = length; - return FOREIGN_SEQUENCE; - } - + *consumed = 4; bracketed_paste = (seq[2] == '0'); return BRACKETED_PASTE_MARKER; + } else { + *consumed = length; + return FOREIGN_SEQUENCE; } #endif break;