mirror of
https://github.com/jarun/nnn.git
synced 2025-01-09 17:39:38 +00:00
Fix #1162: run commands as plugin through shell
This commit is contained in:
parent
e7aec90889
commit
27e1eb54c4
4
nnn.1
4
nnn.1
|
@ -382,8 +382,8 @@ separated by \fI;\fR:
|
||||||
export NNN_PLUG='p:-plugin'
|
export NNN_PLUG='p:-plugin'
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
To assign keys to arbitrary non-background non-shell-interpreted cli
|
To assign keys to arbitrary non-background cli commands and invoke like
|
||||||
commands and invoke like plugins, add \fI!\fR before the command.
|
plugins, add \fI!\fR before the command.
|
||||||
.Bd -literal
|
.Bd -literal
|
||||||
export NNN_PLUG='x:!chmod +x $nnn;g:!git log;s:!smplayer $nnn'
|
export NNN_PLUG='x:!chmod +x $nnn;g:!git log;s:!smplayer $nnn'
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ export NNN_PLUG='p:-plugin'
|
||||||
|
|
||||||
## Running commands as plugin
|
## Running commands as plugin
|
||||||
|
|
||||||
To assign keys to arbitrary non-background, non-shell-interpreted cli commands and invoke like plugins, add `!` (underscore) before the command.
|
To assign keys to arbitrary non-background cli commands and invoke like plugins, add `!` (underscore) before the command.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
export NNN_PLUG='x:!chmod +x $nnn;g:!git log;s:!smplayer $nnn'
|
export NNN_PLUG='x:!chmod +x $nnn;g:!git log;s:!smplayer $nnn'
|
||||||
|
|
|
@ -5120,9 +5120,9 @@ static bool run_cmd_as_plugin(const char *file, uchar_t flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & F_PAGE)
|
if (flags & F_PAGE)
|
||||||
get_output(g_buf, NULL, NULL, -1, TRUE, TRUE);
|
get_output(utils[UTIL_SH_EXEC], g_buf, NULL, -1, TRUE, TRUE);
|
||||||
else
|
else
|
||||||
spawn(g_buf, NULL, NULL, NULL, flags);
|
spawn(utils[UTIL_SH_EXEC], g_buf, NULL, NULL, flags);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue