ansi test

main
Brett 2025-03-06 01:09:44 -05:00
parent 08e19c067e
commit c4a29ade19
2 changed files with 20 additions and 1 deletions

View File

@ -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)

View File

@ -21,6 +21,9 @@
#include <blt/logging/logging.h>
#include <blt/std/assert.h>
#include <blt/std/utility.h>
#include <thread>
#include <chrono>
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");
}