tDo not wait for user input on PAGER exit - sacc - sacc (saccomys): simple goph… | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit ff115925b71781e2f000218d6d0e9d624c863cdb | |
parent 1ac106d2827cab446cf673c12c021ae7d2cee9fe | |
Author: Quentin Rameau <[email protected]> | |
Date: Fri, 25 Aug 2017 14:07:43 +0200 | |
Do not wait for user input on PAGER exit | |
This is handy if your pager automatically exits without prompting the | |
user, but this isn't the behaviour recommended by POSIX more, so the | |
user is responsible for it otherwise. | |
Diffstat: | |
sacc.c | 8 ++------ | |
1 file changed, 2 insertions(+), 6 deletions(-) | |
--- | |
diff --git a/sacc.c b/sacc.c | |
t@@ -172,7 +172,7 @@ static void | |
displaytextitem(Item *item) | |
{ | |
FILE *pagerin; | |
- int pid, wpid, status; | |
+ int pid, wpid; | |
uicleanup(); | |
switch (pid = fork()) { | |
t@@ -183,11 +183,7 @@ displaytextitem(Item *item) | |
parent = 0; | |
pagerin = popen("$PAGER", "we"); | |
fputs(item->raw, pagerin); | |
- status = pclose(pagerin); | |
- fputs("[Press Enter to continue]", stdout); | |
- fflush(stdout); | |
- getchar(); | |
- exit(status); | |
+ exit(pclose(pagerin)); | |
default: | |
while ((wpid = wait(NULL)) >= 0 && wpid != pid) | |
; |