Keep text file displayed until user hits enter - sacc - sacc(omys), simple console gopher client
(HTM) git clone git://bitreich.org/sacc/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/sacc/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) LICENSE
---
(DIR) commit 641ce728054743d3f0475ba6c35bafb6d2bc10ac
(DIR) parent cea0177aa0fa82195efa6dd16c15dcc47af5bba5
(HTM) Author: Quentin Rameau <quinq@fifth.space>
Date: Mon, 3 Jul 2017 00:43:12 +0200
Keep text file displayed until user hits enter
Diffstat:
M sacc.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/sacc.c b/sacc.c
@@ -121,7 +121,7 @@ static void
displaytextitem(Item *item)
{
FILE *pagerin;
- int pid, wpid;
+ int pid, wpid, status;
uicleanup();
switch (pid = fork()) {
@@ -131,7 +131,10 @@ displaytextitem(Item *item)
case 0:
pagerin = popen("$PAGER", "we");
fputs(item->raw, pagerin);
- exit(pclose(pagerin));
+ status = pclose(pagerin);
+ fputs("[ Press Enter to continue ]", stdout);
+ getchar();
+ exit(status);
default:
while ((wpid = wait(NULL)) >= 0 && wpid != pid)
;