mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 21:36:42 +00:00
Revert "Paging is achieved through shell command now"
This reverts commit 243301603e
.
This commit is contained in:
parent
243301603e
commit
df05f593de
1
nnn.1
1
nnn.1
|
@ -448,6 +448,7 @@ separated by \fI;\fR:
|
||||||
add \fB|\fR (pipe) after \fB!\fR
|
add \fB|\fR (pipe) after \fB!\fR
|
||||||
Note: This option is incompatible with \fB&\fR (terminal output is masked
|
Note: This option is incompatible with \fB&\fR (terminal output is masked
|
||||||
for GUI programs) and ignores \fB*\fR (output is already paged for user).
|
for GUI programs) and ignores \fB*\fR (output is already paged for user).
|
||||||
|
\fI$nnn\fR must be the last argument in this case as well.
|
||||||
|
|
||||||
export NNN_PLUG='m:-!|mediainfo $nnn;t:-!|tree -ps;l:-!|ls -lah --group-directories-first'
|
export NNN_PLUG='m:-!|mediainfo $nnn;t:-!|tree -ps;l:-!|ls -lah --group-directories-first'
|
||||||
|
|
||||||
|
|
|
@ -180,6 +180,7 @@ export NNN_PLUG='m:-!|mediainfo $nnn;t:-!|tree -ps;l:-!|ls -lah --group-director
|
||||||
```
|
```
|
||||||
|
|
||||||
This option is incompatible with `&` (terminal output is masked for GUI programs) and ignores `*` (output is already paged for user).
|
This option is incompatible with `&` (terminal output is masked for GUI programs) and ignores `*` (output is already paged for user).
|
||||||
|
`$nnn` must be the last argument in this case as well.
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
|
|
||||||
|
|
14
src/nnn.c
14
src/nnn.c
|
@ -5192,23 +5192,27 @@ static void setexports(void)
|
||||||
|
|
||||||
static void run_cmd_as_plugin(const char *file, char *runfile, uchar_t flags)
|
static void run_cmd_as_plugin(const char *file, char *runfile, uchar_t flags)
|
||||||
{
|
{
|
||||||
size_t len = xstrsncpy(g_buf, file, PATH_MAX) - 1;
|
size_t len;
|
||||||
|
|
||||||
|
xstrsncpy(g_buf, file, PATH_MAX);
|
||||||
|
|
||||||
|
len = xstrlen(g_buf);
|
||||||
if (len > 1 && g_buf[len - 1] == '*') {
|
if (len > 1 && g_buf[len - 1] == '*') {
|
||||||
flags &= ~F_CONFIRM; /* Skip user confirmation */
|
flags &= ~F_CONFIRM; /* Skip user confirmation */
|
||||||
g_buf[len - 1] = '\0'; /* Get rid of trailing no confirmation symbol */
|
g_buf[len - 1] = '\0'; /* Get rid of trailing no confirmation symbol */
|
||||||
--len;
|
--len;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & F_PAGE)
|
if ((flags & F_PAGE) || (flags & F_NOTRACE)) {
|
||||||
get_output(g_buf, NULL, NULL, -1, TRUE);
|
|
||||||
else if (flags & F_NOTRACE) {
|
|
||||||
if (is_suffix(g_buf, " $nnn"))
|
if (is_suffix(g_buf, " $nnn"))
|
||||||
g_buf[len - 5] = '\0';
|
g_buf[len - 5] = '\0';
|
||||||
else
|
else
|
||||||
runfile = NULL;
|
runfile = NULL;
|
||||||
|
|
||||||
spawn(g_buf, runfile, NULL, NULL, flags);
|
if (flags & F_PAGE)
|
||||||
|
get_output(g_buf, runfile, NULL, -1, TRUE);
|
||||||
|
else // F_NOTRACE
|
||||||
|
spawn(g_buf, runfile, NULL, NULL, flags);
|
||||||
} else
|
} else
|
||||||
spawn(utils[UTIL_SH_EXEC], g_buf, NULL, NULL, flags);
|
spawn(utils[UTIL_SH_EXEC], g_buf, NULL, NULL, flags);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue