[FarGroup/FarManager] master: gh-993: Use DECSET 2026 to reduce flickering (8a3567f45)

0 views
Skip to first unread message

farg...@farmanager.com

unread,
Aug 26, 2025, 5:45:51 PM (12 days ago) Aug 26
to farco...@googlegroups.com
Repository : https://github.com/FarGroup/FarManager
On branch : master
Link : https://github.com/FarGroup/FarManager/commit/8a3567f45b4d7d84265e71ef031518a098254871

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

commit 8a3567f45b4d7d84265e71ef031518a098254871
Author: Alex Alabuzhev <alab...@gmail.com>
Date: Tue Aug 26 22:34:24 2025 +0100

gh-993: Use DECSET 2026 to reduce flickering


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

8a3567f45b4d7d84265e71ef031518a098254871
far/changelog | 5 +++++
far/console.cpp | 41 +++++++++++++++++++++++++++++++++++++++++
far/vbuild.m4 | 2 +-
3 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/far/changelog b/far/changelog
index 2fa3882c1..3e4e0f65d 100644
--- a/far/changelog
+++ b/far/changelog
@@ -1,3 +1,8 @@
+--------------------------------------------------------------------------------
+drkns 2025-08-26 22:32:24+01:00 - build 6539
+
+1. gh-993: Use DECSET 2026 to reduce flickering.
+
--------------------------------------------------------------------------------
shmuel 2025-08-26 20:48:18+03:00 - build 6538

diff --git a/far/console.cpp b/far/console.cpp
index a2f07605b..38b40cf3c 100644
--- a/far/console.cpp
+++ b/far/console.cpp
@@ -2315,8 +2315,49 @@ protected:
return implementation::WriteOutputNT(Buffer, BufferCoord, WriteRegion);
}

+ static bool is_synchronized_output_supported()
+ {
+ static const auto Result = []
+ {
+ const auto Response = decrqm(L"2026"sv);
+ if (!Response)
+ return false;
+
+ switch (*Response)
+ {
+ case L'1':
+ case L'2':
+ return true;
+
+ case L'3':
+ case L'4':
+ return false;
+
+ default:
+ std::unreachable();
+ }
+ }();
+
+ return Result;
+ }
+
+ static void begin_synchronized_update()
+ {
+ if (is_synchronized_output_supported())
+ send_vt_command(CSI L"?2026h"sv);
+ }
+
+ static void end_synchronized_update()
+ {
+ if (is_synchronized_output_supported())
+ send_vt_command(CSI L"?2026l"sv);
+ }
+
bool console::WriteOutputGather(matrix<FAR_CHAR_INFO>& Buffer, std::span<rectangle const> WriteRegions) const
{
+ begin_synchronized_update();
+ SCOPE_EXIT{ end_synchronized_update(); };
+
// TODO: VT can handle this in one go
for (const auto& i: WriteRegions)
{
diff --git a/far/vbuild.m4 b/far/vbuild.m4
index e21880f20..b0b20f198 100644
--- a/far/vbuild.m4
+++ b/far/vbuild.m4
@@ -1 +1 @@
-6538
+6539


Reply all
Reply to author
Forward
0 new messages