From 25d5559596a3d2e884d67cad63fdd04dc5c694e7 Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 11 Oct 2024 15:01:26 +0400 Subject: [PATCH] fix #2410, Strange behavior for NumEnter (screen redraw issue) --- far2l/src/console/scrbuf.hpp | 9 +++++++++ far2l/src/execute.cpp | 1 + 2 files changed, 10 insertions(+) diff --git a/far2l/src/console/scrbuf.hpp b/far2l/src/console/scrbuf.hpp index de810246d..f44aaca5b 100644 --- a/far2l/src/console/scrbuf.hpp +++ b/far2l/src/console/scrbuf.hpp @@ -92,3 +92,12 @@ class ScreenBuf }; extern ScreenBuf ScrBuf; + +class UnlockScreen +{ +private: + int Count; +public: + UnlockScreen() : Count(ScrBuf.GetLockCount()) { ScrBuf.Unlock(); } + ~UnlockScreen() { ScrBuf.SetLockCount(Count); } +}; diff --git a/far2l/src/execute.cpp b/far2l/src/execute.cpp index b397948ae..c51b46812 100644 --- a/far2l/src/execute.cpp +++ b/far2l/src/execute.cpp @@ -309,6 +309,7 @@ static int farExecuteASynched(const char *CmdStr, unsigned int ExecFlags) } } else { + UnlockScreen Unlock; FarExecuteScope fes((ExecFlags & EF_NOCMDPRINT) ? "" : CmdStr); r = VTShell_Execute(CmdStr, (ExecFlags & EF_SUDO) != 0, (ExecFlags & EF_MAYBGND) != 0, may_notify); }