From: Jeff King Date: Mon, 15 Feb 2010 05:37:47 GMT Subject: Re: [PATCH v2 6/6] tests: Add tests for automatic use of pager Message-ID: <20100215053747.GA4897@coredump.intra.peff.net> In-Reply-To: <20100215053521.GA22121@progeny.tock> On Sun, Feb 14, 2010 at 11:35:21PM -0600, Jonathan Nieder wrote: > How about this? It seems a little simpler, though it might be less > reliable. > [...] > +if eval "exec 8>/dev/tty" 2>/dev/null && test -t 8 Right, it still breaks if we don't have a tty at all. Which is perhaps not the "99% of runs" I mentioned before, but I think is not all that uncommon (e.g., cron jobs). -Peff