13#include <zypp-tui/Application>
21 { return ::getenv(
"NO_COLOR"); }
42 char *
term = ::getenv(
"TERM");
43 if (
term && ::strcmp(
term,
"dumb" ) )
60 const EscapeSequence
clearLN (
"\033[2K\r",
"\n" );
61 const EscapeSequence
cursorUP (
"\033[1A" );
70 static const std::map<std::string, ansi::Color>
_def = {
110 ERR <<
"Unknown color name '" <<
name_r <<
"'" << std::endl;
static Application & instance()
Various ways to define ansi SGR sequences.
static Color fromString(const std::string &colorName)
static Color nocolor()
Leave everything unchanged.
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
const EscapeSequence cursorUP
Cursor up 1 line.
const EscapeSequence clearLN
Clear entire line.
const EscapeSequence cursorDOWN
Cursor down 1 line.
const EscapeSequence cursorRIGHT
Cursor right 1 char.
const EscapeSequence cursorLEFT
Cursor left 1 char.
bool mayUseANSIEscapes()
Simple check whether stdout is a (not dumb) tty.
ansi::Color customColorCtor(ColorContext ctxt_r)
bool do_ttyout()
True unless output is a dumb tty or file.
bool hasANSIColor()
Simple check whether stdout can handle colors.
bool do_colors()
If output is done in colors (depends on config)
Namespace intended to collect all environment variables we use.
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
std::string toLower(const std::string &s)
Return lowercase version of s.