From c4a29ade1964fecbfdb3a69ec005f903b2e0bdae Mon Sep 17 00:00:00 2001 From: Brett Date: Thu, 6 Mar 2025 01:09:44 -0500 Subject: [PATCH] ansi test --- CMakeLists.txt | 2 +- tests/logger_tests.cpp | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b0e6bde..3606e16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.20) include(cmake/color.cmake) -set(BLT_VERSION 5.1.11) +set(BLT_VERSION 5.1.12) set(BLT_TARGET BLT) diff --git a/tests/logger_tests.cpp b/tests/logger_tests.cpp index 0f318cd..a120b32 100644 --- a/tests/logger_tests.cpp +++ b/tests/logger_tests.cpp @@ -21,6 +21,9 @@ #include #include #include +#include +#include + struct some_silly_type_t {}; @@ -153,5 +156,21 @@ int main() build(color::color_mode::BOLD, fg(color::color8::CYAN), color::color_mode::DIM, bg(color::color8::YELLOW)), build(color::color_mode::RESET_ALL)); + std::cout << "\033[2J"; + + constexpr int totalRows = 24; + std::cout << "\033[1;" << (totalRows - 1) << "r"; + + for (int i = 1; i <= 10; ++i) + { + std::cout << "\033[1;1H"; + std::cout << "printed line " << i << std::endl; + std::cout << "\033[" << totalRows << ";1H"; + std::cout << "[----status----]" << std::flush; + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + } + + std::cout << "\033[r"; + // blt::logging::println("This is println {}\twith a std::endl in the middle of it"); }