mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-20 13:21:28 +00:00
[Console] Add IS_TTY to force terminal coloring output (#3021)
This commit is contained in:
parent
2a6cf8c8e7
commit
e3f9b396ab
@ -42,6 +42,8 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
inline bool g_is_forced_tty = std::getenv("IS_TTY");
|
||||||
|
|
||||||
namespace rang {
|
namespace rang {
|
||||||
|
|
||||||
/* For better compability with most of terminals do not use any style settings
|
/* For better compability with most of terminals do not use any style settings
|
||||||
@ -220,6 +222,10 @@ inline bool isMsysPty(int fd) noexcept
|
|||||||
|
|
||||||
inline bool isTerminal(const std::streambuf *osbuf) noexcept
|
inline bool isTerminal(const std::streambuf *osbuf) noexcept
|
||||||
{
|
{
|
||||||
|
if (g_is_forced_tty) {
|
||||||
|
return g_is_forced_tty;
|
||||||
|
}
|
||||||
|
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
using std::clog;
|
using std::clog;
|
||||||
using std::cout;
|
using std::cout;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user