summaryrefslogtreecommitdiff
path: root/src/apk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/apk.c')
-rw-r--r--src/apk.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/apk.c b/src/apk.c
index ee51c79..33d2ec1 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -417,11 +417,16 @@ static void setup_terminal(void)
static void setup_automatic_flags(void)
{
+ const char *tmp;
+
if (!isatty(STDOUT_FILENO) || !isatty(STDERR_FILENO) ||
!isatty(STDIN_FILENO))
return;
- apk_flags |= APK_PROGRESS;
+ /* Enable progress bar by default, except on dumb terminals. */
+ if (!(tmp = getenv("TERM")) || strcmp(tmp, "dumb") != 0)
+ apk_flags |= APK_PROGRESS;
+
if (!(apk_flags & APK_SIMULATE) &&
access("/etc/apk/interactive", F_OK) == 0)
apk_flags |= APK_INTERACTIVE;