Add message when no true color support

This commit is contained in:
Bob Polis 2024-01-18 10:46:28 +01:00
parent a9fccef300
commit 83d26d9be0

View File

@ -120,8 +120,10 @@ void show_words() {
void show_truecolor(const sc::term& t) { void show_truecolor(const sc::term& t) {
// check for true color support // check for true color support
char* support = getenv("COLORTERM"); char* support = getenv("COLORTERM");
if (!support || support[0] == '\0') return; if (!support || support[0] == '\0') {
std::cerr << "no true color support\n";
return;
}
const char* lhb = u8"\u2584"; // lower half block const char* lhb = u8"\u2584"; // lower half block
int inc = 6.0 * t.cols() / 256.0; int inc = 6.0 * t.cols() / 256.0;
if (inc == 0) inc = 1; if (inc == 0) inc = 1;