Closed hctym1995 closed 3 years ago
which terminal are you using? Perhaps it is not in the list defined here: https://github.com/gabime/spdlog/blob/036cc5d5753169075f28425a0a63deb708d01fec/include/spdlog/details/os-inl.h#L418
thanks for your quick response
I'm using xshell now
I tried it with mobaxterm. It works, but I'm not sure if it's because mobaxterm will color it automatically
thanks for your quick response
I'm using xshell now
I tried it with mobaxterm. It works, but I'm not sure if it's because mobaxterm will color it automatically
i tried it with putty, no Colored-Text either
You could try exporting COLORTERM env variable before running.
i tried to export COLORTERM, it doesn't work
BUT
i wrote "return true;"
in function:
SPDLOG_INLINE bool is_color_terminal() SPDLOG_NOEXCEPT
(spdlog/include/spdlog/details/os-inl.h)
and it works..........
` SPDLOG_INLINE bool is_color_terminal() SPDLOG_NOEXCEPT { return true; //i wrote here
return true;
#else
static const bool result = []() {
const char *env_colorterm_p = std::getenv("COLORTERM");
if (env_colorterm_p != nullptr)
{
return true;
}
static constexpr std::array<const char *, 15> terms = {{"ansi", "color", "console", "cygwin", "gnome", "konsole", "kterm", "linux",
"msys", "putty", "rxvt", "screen", "vt100", "xterm", "alacritty"}};
const char *env_term_p = std::getenv("TERM");
if (env_term_p == nullptr)
{
return false;
}
return std::any_of(terms.begin(), terms.end(), [&](const char *term) { return std::strstr(env_term_p, term) != nullptr; });
}();
return result;
#endif
}
`
As you can see in the code, if COLORTERM is found it returns true as well. If you know the TERM env var please open a pr.
As you can see in the code, if COLORTERM is found it returns true as well. If you know the TERM env var please open a pr.
ok, i'll try to find it
os:linux compiler:riscv-gnu-g++
i cross-compile spodlog(V1.8.5) in my RISC-V program,but there is no Color-Text in stdout when i run program
I used to work well on windows and x86-Linux
i tried to use spdlog::set_color_mode, but it seems to have failed... :-(