Add true color detection
This commit is contained in:
@ -60,6 +60,12 @@ void term::progress(int prefixlen,
|
||||
*_out << ' ' << std::setw(3) << perc << '%';
|
||||
}
|
||||
|
||||
bool term::has_truecolor() const {
|
||||
char* tc = getenv("COLORTERM");
|
||||
std::string colorterm {tc ? tc : ""};
|
||||
return colorterm.size() > 0 && (colorterm == "truecolor" || colorterm == "24bit");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
cursor_hider::cursor_hider(std::ostream* out) : _out {out} {
|
||||
|
Reference in New Issue
Block a user