mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
Respect TERM=dumb more consistently
This commit is contained in:
parent
139f7af5ec
commit
20cce079f2
4 changed files with 9 additions and 2 deletions
|
@ -484,7 +484,7 @@ Logger * makeProgressBar(bool printBuildLogs)
|
||||||
{
|
{
|
||||||
return new ProgressBar(
|
return new ProgressBar(
|
||||||
printBuildLogs,
|
printBuildLogs,
|
||||||
isatty(STDERR_FILENO) && getEnv("TERM").value_or("dumb") != "dumb"
|
shouldANSI()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ public:
|
||||||
: printBuildLogs(printBuildLogs)
|
: printBuildLogs(printBuildLogs)
|
||||||
{
|
{
|
||||||
systemd = getEnv("IN_SYSTEMD") == "1";
|
systemd = getEnv("IN_SYSTEMD") == "1";
|
||||||
tty = isatty(STDERR_FILENO);
|
tty = shouldANSI();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isVerbose() override {
|
bool isVerbose() override {
|
||||||
|
|
|
@ -1372,6 +1372,10 @@ void ignoreException()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool shouldANSI()
|
||||||
|
{
|
||||||
|
return isatty(STDERR_FILENO) && getEnv("TERM").value_or("dumb") != "dumb";
|
||||||
|
}
|
||||||
|
|
||||||
std::string filterANSIEscapes(const std::string & s, bool filterAll, unsigned int width)
|
std::string filterANSIEscapes(const std::string & s, bool filterAll, unsigned int width)
|
||||||
{
|
{
|
||||||
|
|
|
@ -482,6 +482,9 @@ constexpr char treeLast[] = "└───";
|
||||||
constexpr char treeLine[] = "│ ";
|
constexpr char treeLine[] = "│ ";
|
||||||
constexpr char treeNull[] = " ";
|
constexpr char treeNull[] = " ";
|
||||||
|
|
||||||
|
/* Determine whether ANSI escape sequences are appropriate for the
|
||||||
|
present output. */
|
||||||
|
bool shouldANSI();
|
||||||
|
|
||||||
/* Truncate a string to 'width' printable characters. If 'filterAll'
|
/* Truncate a string to 'width' printable characters. If 'filterAll'
|
||||||
is true, all ANSI escape sequences are filtered out. Otherwise,
|
is true, all ANSI escape sequences are filtered out. Otherwise,
|
||||||
|
|
Loading…
Reference in a new issue