]> git.ipfire.org Git - thirdparty/git.git/blobdiff - pager.c
New tests and en-passant modifications to mktag.
[thirdparty/git.git] / pager.c
diff --git a/pager.c b/pager.c
index b063353d96eb6d526438c1fa22cacd28bc12b0c1..280f57f796c84d1c1fd54e295b542c3b33490b3e 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -8,6 +8,7 @@
 static void run_pager(const char *pager)
 {
        execlp(pager, pager, NULL);
+       execl("/bin/sh", "sh", "-c", pager, NULL);
 }
 
 void setup_pager(void)
@@ -23,6 +24,8 @@ void setup_pager(void)
        else if (!*pager || !strcmp(pager, "cat"))
                return;
 
+       pager_in_use = 1; /* means we are emitting to terminal */
+
        if (pipe(fd) < 0)
                return;
        pid = fork();
@@ -45,7 +48,8 @@ void setup_pager(void)
        close(fd[0]);
        close(fd[1]);
 
-       setenv("LESS", "-S", 0);
+       setenv("LESS", "-RS", 0);
        run_pager(pager);
+       die("unable to execute pager '%s'", pager);
        exit(255);
 }