Paging is achieved through shell command now

This commit is contained in:
Arun Prakash Jana 2023-01-15 11:46:03 +05:30
parent f9281c8eab
commit 243301603e
No known key found for this signature in database
GPG key ID: A75979F35C080412
3 changed files with 5 additions and 11 deletions

1
nnn.1
View file

@ -448,7 +448,6 @@ separated by \fI;\fR:
add \fB|\fR (pipe) after \fB!\fR
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).
\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'

View file

@ -180,7 +180,6 @@ 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).
`$nnn` must be the last argument in this case as well.
Notes:

View file

@ -5192,27 +5192,23 @@ static void setexports(void)
static void run_cmd_as_plugin(const char *file, char *runfile, uchar_t flags)
{
size_t len;
size_t len = xstrsncpy(g_buf, file, PATH_MAX) - 1;
xstrsncpy(g_buf, file, PATH_MAX);
len = xstrlen(g_buf);
if (len > 1 && g_buf[len - 1] == '*') {
flags &= ~F_CONFIRM; /* Skip user confirmation */
g_buf[len - 1] = '\0'; /* Get rid of trailing no confirmation symbol */
--len;
}
if ((flags & F_PAGE) || (flags & F_NOTRACE)) {
if (flags & F_PAGE)
get_output(g_buf, NULL, NULL, -1, TRUE);
else if (flags & F_NOTRACE) {
if (is_suffix(g_buf, " $nnn"))
g_buf[len - 5] = '\0';
else
runfile = NULL;
if (flags & F_PAGE)
get_output(g_buf, runfile, NULL, -1, TRUE);
else // F_NOTRACE
spawn(g_buf, runfile, NULL, NULL, flags);
spawn(g_buf, runfile, NULL, NULL, flags);
} else
spawn(utils[UTIL_SH_EXEC], g_buf, NULL, NULL, flags);
}