aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-06-28 15:54:09 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:51 +0100
commit2f791a23fdf76b0116d3f1b506d9adf696f98f7f (patch)
treeca0a54ef700f00f74c58d9967b408dcb692625db /src
parent8d8b66de06e91413f368b27d27562471fc2d2adc (diff)
Hide progress bar when program is running in the background
Diffstat (limited to 'src')
-rw-r--r--src/utils.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index 9348dc00..649d2b1c 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -53,6 +53,7 @@ void progress_bar(int val, int total, const char *text)
const int width = 50;
if ( !isatty(STDERR_FILENO) ) return;
+ if ( tcgetpgrp(STDERR_FILENO) != getpgrp() ) return;
frac = (double)val/total;
n = (int)(frac*width);