3 #include <sys/select.h>
6 * This is split up from the rest of git so that we might do
7 * something different on Windows, for example.
10 static void run_pager(const char *pager)
13 * Work around bug in "less" by not starting it until we
20 select(1, &in, NULL, &in, NULL);
22 execlp(pager, pager, NULL);
23 execl("/bin/sh", "sh", "-c", pager, NULL);
26 void setup_pager(void)
30 const char *pager = getenv("GIT_PAGER");
35 pager = getenv("PAGER");
38 else if (!*pager || !strcmp(pager, "cat"))
41 pager_in_use = 1; /* means we are emitting to terminal */
52 /* return in the child */
60 /* The original process turns into the PAGER */
65 setenv("LESS", "FRSX", 0);
67 die("unable to execute pager '%s'", pager);