Have to force the terminal detected by FTXUI to use full color no matter what it detects in the actual terminal.

This commit is contained in:
Zed A. Shaw 2024-11-03 00:16:52 -04:00
parent 0ba789697a
commit 707e9e3d6e
7 changed files with 16 additions and 5 deletions

View file

@ -3,7 +3,7 @@
#include <string>
#include "ansi_parser.hpp"
#include <codecvt>
#include <iostream>
#include "ftxui/dom/elements.hpp" // for text, bgcolor, color, vbox, hbox, separator, operator|, Elements, Element, Fit, border
#include "ftxui/dom/node.hpp" // for Render
@ -53,10 +53,13 @@ std::string generate_colors() {
TEST_CASE("test out ragel parser", "[gui]") {
std::string colors = generate_colors();
std::cout << colors;
sf::Color default_fg(0,0,0);
sf::Color default_bg(100,100,100);
ANSIParser parser(default_fg, default_bg);
REQUIRE(ftxui::Terminal::ColorSupport() == Terminal::Color::TrueColor);
bool good = parser.parse(colors, [&](sf::Color bgcolor, sf::Color color, wchar_t ch) {
bool correct_char = ch == '#' || ch == ' ' || ch == '\n' || ch == '\r';
REQUIRE(correct_char);