aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-06-15 21:47:37 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-06-15 21:47:37 +0530
commit538995487bbe00bab8190c360f3b0a4aa5d9da47 (patch)
treece70b60962afb33c2af0a9363e6997b4be46edee /src
parentc0bd33e3f61d0142ab66321c8bebf0a2ed5ec245 (diff)
downloadnnn-538995487bbe00bab8190c360f3b0a4aa5d9da47.tar.gz
Wait and show command output when running a command
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/nnn.c b/src/nnn.c
index db57b61..cc6541c 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -146,6 +146,7 @@
#define F_NOWAIT 0x02 /* don't wait for child process (e.g. file manager) */
#define F_NOTRACE 0x04 /* suppress stdout and strerr (no traces) */
#define F_NORMAL 0x08 /* spawn child process in non-curses regular CLI mode */
+#define F_CMD 0x10 /* run command - show results before exit (must have F_NORMAL) */
#define F_CLI (F_NORMAL | F_MULTI)
@@ -1038,8 +1039,14 @@ static int spawn(char *file, char *arg1, char *arg2, const char *dir, uchar flag
retstatus = join(pid, flag);
DPRINTF_D(pid);
- if (flag & F_NORMAL)
+ if (flag & F_NORMAL) {
+ if (flag & F_CMD) {
+ printf("\nPress Enter to continue");
+ getchar();
+ }
+
refresh();
+ }
free(cmd);
}
@@ -4172,7 +4179,7 @@ nochange:
}
#endif
if (tmp && tmp[0]) // NOLINT
- spawn(shell, "-c", tmp, path, F_CLI);
+ spawn(shell, "-c", tmp, path, F_CLI | F_CMD);
}
/* Continue in navigate-as-you-type mode, if enabled */