On Tue, May 21, 2024 at 03:00:10PM -0700, Junio C Hamano wrote: > Rubén Justo <rjusto@xxxxxxxxx> writes: > > > Adding logic to adjust when we close(stderr) in close_pager_fds() makes > > sense on its own, I think. > > The feature may be. > > > And, the values for the flag "do-we-want-to-close-stderr-at-exit", too, > > to me. > > But the thing is, the flag is *NOT* named as such, and an > undocumented "value -1 means X, while value 1 means Y", do not make > any sense, either Perhaps this makes more sense?: 1: 8fe915a820 ! 1: 70cc34efc4 pager: do not close fd 2 unnecessarily @@ pager.c: int pager_use_color = 1; static struct child_process pager_process; static const char *pager_program; -+static int old_fd2 = -1; ++static int old_fd2; /* Is the value coming back from term_columns() just a guess? */ static int term_columns_guessed; @@ pager.c: static void close_pager_fds(void) /* signal EOF to pager */ close(1); - close(2); -+ if (old_fd2 != -1) ++ if (old_fd2) + close(2); }