4 * This is split up from the rest of git so that we might do
5 * something different on Windows, for example.
8 static void run_pager(const char *pager
)
10 execlp(pager
, pager
, NULL
);
11 execl("/bin/sh", "sh", "-c", pager
, NULL
);
14 void setup_pager(void)
18 const char *pager
= getenv("PAGER");
24 else if (!*pager
|| !strcmp(pager
, "cat"))
27 pager_in_use
= 1; /* means we are emitting to terminal */
38 /* return in the child */
46 /* The original process turns into the PAGER */
51 setenv("LESS", "-RS", 0);
53 die("unable to execute pager '%s'", pager
);