summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--scoop.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/scoop.c b/scoop.c
index d95a971..4c4ee35 100644
--- a/scoop.c
+++ b/scoop.c
@@ -495,7 +495,9 @@ int main(int argc, char *argv[]) {
 	}
 
 	if (tty) {
+		const char *shell = getenv("SHELL");
 		const char *pager = getenv("PAGER");
+		if (!shell) shell = "/bin/sh";
 		if (!pager) pager = "less";
 		setenv("LESS", "FRX", 0);
 
@@ -510,8 +512,8 @@ int main(int argc, char *argv[]) {
 			dup2(rw[0], STDIN_FILENO);
 			close(rw[0]);
 			close(rw[1]);
-			execlp(pager, pager, NULL);
-			err(EX_CONFIG, "%s", pager);
+			execl(shell, shell, "-c", pager, NULL);
+			err(EX_CONFIG, "%s", shell);
 		}
 
 		dup2(rw[1], STDOUT_FILENO);