Skip to content

Commit 17e785f

Browse files
committed
Merge branch 'lm/squelch-bg-progress'
The controlling tty-based heuristics to squelch progress output did not consider that the process may not be talking to a tty at all (e.g. sending the progress to sideband #2). This is a finishing touch to a topic that is already in 'master'. * lm/squelch-bg-progress: progress: treat "no terminal" as being in the foreground
2 parents ddaf4e2 + a4fb76c commit 17e785f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

progress.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ static void clear_progress_signal(void)
7474

7575
static int is_foreground_fd(int fd)
7676
{
77-
return getpgid(0) == tcgetpgrp(fd);
77+
int tpgrp = tcgetpgrp(fd);
78+
return tpgrp < 0 || tpgrp == getpgid(0);
7879
}
7980

8081
static int display(struct progress *progress, unsigned n, const char *done)

0 commit comments

Comments
 (0)