[FarGroup/FarManager] master: Fix VT response reading in the presence of user input (5dbedd1e4)

0 views
Skip to first unread message

farg...@farmanager.com

unread,
Dec 19, 2025, 6:30:57 PM (7 days ago) Dec 19
to farco...@googlegroups.com
Repository : https://github.com/FarGroup/FarManager
On branch : master
Link : https://github.com/FarGroup/FarManager/commit/5dbedd1e451dd986966b2da63310c1c8967f17c1

>---------------------------------------------------------------

commit 5dbedd1e451dd986966b2da63310c1c8967f17c1
Author: Alex Alabuzhev <alab...@gmail.com>
Date: Fri Dec 19 23:18:18 2025 +0000

Fix VT response reading in the presence of user input


>---------------------------------------------------------------

5dbedd1e451dd986966b2da63310c1c8967f17c1
far/changelog | 5 +++++
far/console.cpp | 4 ++--
far/vbuild.m4 | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/far/changelog b/far/changelog
index e041d10c5..b7f849154 100644
--- a/far/changelog
+++ b/far/changelog
@@ -1,3 +1,8 @@
+--------------------------------------------------------------------------------
+drkns 2025-12-19 23:14:02+00:00 - build 6617
+
+1. Fix VT response reading in the presence of user input.
+
--------------------------------------------------------------------------------
drkns 2025-12-14 20:12:20+00:00 - build 6616

diff --git a/far/console.cpp b/far/console.cpp
index e809841f1..7aa77d5ab 100644
--- a/far/console.cpp
+++ b/far/console.cpp
@@ -655,13 +655,13 @@ protected:
if (const auto Pos = Response.find(TokenSuffix, *FirstTokenPrefixPos + TokenPrefix.size()); Pos != Response.npos)
{
FirstTokenSuffixPos = Pos;
- DA_ResponseSize = Pos + TokenSuffix.size();
+ DA_ResponseSize = Pos + TokenSuffix.size() - *FirstTokenPrefixPos;
}

if (DA_ResponseSize && Response.size() >= DA_ResponseSize * 2)
{
const auto FirstTokenEnd = *FirstTokenPrefixPos + DA_ResponseSize;
- const auto DA_Response = string_view(Response).substr(*FirstTokenPrefixPos, FirstTokenEnd);
+ const auto DA_Response = string_view(Response).substr(*FirstTokenPrefixPos, DA_ResponseSize);
const auto SecondTokenPos = Response.find(DA_Response, FirstTokenEnd);

if (SecondTokenPos != Response.npos)
diff --git a/far/vbuild.m4 b/far/vbuild.m4
index 8d6f700a0..cc7beecdb 100644
--- a/far/vbuild.m4
+++ b/far/vbuild.m4
@@ -1 +1 @@
-6616
+6617


Reply all
Reply to author
Forward
0 new messages