OS: ubuntu 22.04
output of "echo $TERM": xterm-256color
fmt version: 10.2.1
The following code can print colored text:
std::cout << "\033[1;31mbold red text\033[0m" << std::endl
fmt::color requires RGB color support which is not available on some terminals. You can use fmt::terminal_color instead which is more widely supported:
fmt::color
fmt::terminal_color
#include <fmt/color.h> int main() { fmt::print(fg(fmt::terminal_color::blue), "Test"); }
Godbolt: https://www.godbolt.org/z/e1qj5K8Ys.
fmt::colorrequires RGB color support which is not available on some terminals. You can usefmt::terminal_colorinstead which is more widely supported:Godbolt: https://www.godbolt.org/z/e1qj5K8Ys.