From 01871aee615eb836fcd9721d8547afd5347d0908 Mon Sep 17 00:00:00 2001 From: Reece Wilson Date: Fri, 9 Sep 2022 21:47:53 +0100 Subject: [PATCH] [*] Fix clipboard method to work with older noncan apps. still doesnt work under windows terminal --- Source/Console/ConsoleStd/ConsoleStd.cpp | 5 ++++- Source/Console/ConsoleTTY/ConsoleTTY.cpp | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/Console/ConsoleStd/ConsoleStd.cpp b/Source/Console/ConsoleStd/ConsoleStd.cpp index 2d53fe01..90a4be64 100755 --- a/Source/Console/ConsoleStd/ConsoleStd.cpp +++ b/Source/Console/ConsoleStd/ConsoleStd.cpp @@ -164,8 +164,11 @@ namespace Aurora::Console::ConsoleStd if (newHash != gLastHash) { + if (gLastHash) + { + ConsoleTTY::EnterScrollMode(); + } gLastHash = newHash; - ConsoleTTY::EnterScrollMode(); } ::CloseClipboard(); diff --git a/Source/Console/ConsoleTTY/ConsoleTTY.cpp b/Source/Console/ConsoleTTY/ConsoleTTY.cpp index aec90a34..3218ea2e 100644 --- a/Source/Console/ConsoleTTY/ConsoleTTY.cpp +++ b/Source/Console/ConsoleTTY/ConsoleTTY.cpp @@ -863,6 +863,12 @@ namespace Aurora::Console::ConsoleTTY { if (this->screenBuffer.size() > maxLines) { + static bool bSingleShot {}; + if (!AuExchange(bSingleShot, true)) + { + EnterScrollMode(); + } + // TODO (Reece): Removing optimization bc it was broken. This is a nightmare. auto indexBeforePadding = (this->GetBannerFootBorder() ? 1 + this->topLogPadding : 0) + this->topLogPaddingExtra; auto startIndex = this->GetTopBorder() + this->GetBannerLines() + indexBeforePadding;