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
)
11 * Work around bug in "less" by not starting it until we
18 select(1, &in
, NULL
, &in
, NULL
);
20 execlp(pager
, pager
, NULL
);
21 execl("/bin/sh", "sh", "-c", pager
, NULL
);
24 void setup_pager(void)
28 const char *pager
= getenv("GIT_PAGER");
34 git_config(git_default_config
);
35 pager
= pager_program
;
38 pager
= getenv("PAGER");
41 else if (!*pager
|| !strcmp(pager
, "cat"))
44 pager_in_use
= 1; /* means we are emitting to terminal */
55 /* return in the child */
63 /* The original process turns into the PAGER */
68 setenv("LESS", "FRSX", 0);
70 die("unable to execute pager '%s'", pager
);