| 22 | namespace common { namespace console { |
| 23 | |
| 24 | bool is_console_tty() { |
| 25 | #if defined(_WIN32) |
| 26 | static bool istty = 0 != _isatty(_fileno(stdout)); |
| 27 | #else |
| 28 | static bool istty = 0 != isatty(fileno(stdout)); |
| 29 | #endif |
| 30 | return istty; |
| 31 | } |
| 32 | |
| 33 | void set_text_color(Color color) { |
| 34 | if (!is_console_tty()) { |