mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Wait and show command output when running a command
This commit is contained in:
parent
c0bd33e3f6
commit
538995487b
|
@ -93,7 +93,8 @@ It runs on Linux, macOS, Raspberry Pi, BSD, Cygwin, Linux subsystem for Windows
|
||||||
- Detailed file information
|
- Detailed file information
|
||||||
- Media information (needs mediainfo/exiftool)
|
- Media information (needs mediainfo/exiftool)
|
||||||
- Convenience
|
- Convenience
|
||||||
- Plugin repository
|
- Needs minimal configuration
|
||||||
|
- Rich set of plugins
|
||||||
- Select files across dirs; all/range selection
|
- Select files across dirs; all/range selection
|
||||||
- Copy, move, delete, archive, link selection
|
- Copy, move, delete, archive, link selection
|
||||||
- Batch rename selection or dir entries
|
- Batch rename selection or dir entries
|
||||||
|
|
11
src/nnn.c
11
src/nnn.c
|
@ -146,6 +146,7 @@
|
||||||
#define F_NOWAIT 0x02 /* don't wait for child process (e.g. file manager) */
|
#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_NOTRACE 0x04 /* suppress stdout and strerr (no traces) */
|
||||||
#define F_NORMAL 0x08 /* spawn child process in non-curses regular CLI mode */
|
#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)
|
#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);
|
retstatus = join(pid, flag);
|
||||||
|
|
||||||
DPRINTF_D(pid);
|
DPRINTF_D(pid);
|
||||||
if (flag & F_NORMAL)
|
if (flag & F_NORMAL) {
|
||||||
|
if (flag & F_CMD) {
|
||||||
|
printf("\nPress Enter to continue");
|
||||||
|
getchar();
|
||||||
|
}
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
|
}
|
||||||
|
|
||||||
free(cmd);
|
free(cmd);
|
||||||
}
|
}
|
||||||
|
@ -4172,7 +4179,7 @@ nochange:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (tmp && tmp[0]) // NOLINT
|
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 */
|
/* Continue in navigate-as-you-type mode, if enabled */
|
||||||
|
|
Loading…
Reference in a new issue