From 140abf5dc2b08ef675aee3402f88a929b751f6d5 Mon Sep 17 00:00:00 2001 From: unxed Date: Thu, 24 Nov 2022 20:16:46 +0400 Subject: [PATCH] event type is last char, not always 15th char length of decoded data can vary, so let's make check correct to prevent errors in case of copy-pasting this line of code --- source/platform/terminal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/platform/terminal.cpp b/source/platform/terminal.cpp index 786093ae..7d48472d 100644 --- a/source/platform/terminal.cpp +++ b/source/platform/terminal.cpp @@ -496,7 +496,7 @@ ParseResult TermIO::parseEscapeSeq(GetChBuf &buf, TEvent &ev, MouseState &oldm) const char* out = s.c_str(); KEY_EVENT_RECORD kev {}; - if (strcmp(out + 14, "K") == 0 ) + if (strcmp(out + s.length() - 1, "K") == 0 ) { kev.bKeyDown = 1; memcpy(&kev.wRepeatCount, out, sizeof(kev.wRepeatCount));