Documentation/git-bisect.txt: git bisect term → git bisect terms
[gitweb.git] / progress.c
index 43d9228378858d91f759acd7dbdbcade4de7b46b..2e31bec60f5c98dc7dac69227759cbf2ba5f9974 100644 (file)
@@ -74,7 +74,8 @@ static void clear_progress_signal(void)
 
 static int is_foreground_fd(int fd)
 {
-       return getpgid(0) == tcgetpgrp(fd);
+       int tpgrp = tcgetpgrp(fd);
+       return tpgrp < 0 || tpgrp == getpgid(0);
 }
 
 static int display(struct progress *progress, unsigned n, const char *done)