aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-01-30 23:38:36 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-01-30 23:41:19 +0530
commit6aed714347a34fa29d300b0cfa22adfa5f541ba0 (patch)
treeb8bac0db9e4d171d888ae67a469323ee84f4d4f8 /src
parent46fc9c983c3c62e8c552e70ab9613380b868ae8f (diff)
downloadnnn-6aed714347a34fa29d300b0cfa22adfa5f541ba0.tar.gz
Run GUI app as plugin
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 407616c..53fad5c 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3843,12 +3843,21 @@ static bool run_cmd_as_plugin(const char *path, const char *file, char *newpath,
if (!*file)
return FALSE;
+ /* Check if GUI flags are to be used */
+ if (*file == '|') {
+ flags = F_NOTRACE | F_NOWAIT;
+ ++file;
+
+ if (!*file)
+ return FALSE;
+ }
+
xstrlcpy(newpath, file, PATH_MAX);
len = strlen(newpath);
if (len > 1 && newpath[len - 1] == '*') {
- flags &= ~F_CONFIRM; /* GUI case */
- newpath[len - 1] = '\0'; /* Get rid of trailing nowait symbol */
+ flags &= ~F_CONFIRM; /* Skip user confirmation */
+ newpath[len - 1] = '\0'; /* Get rid of trailing no confirmation symbol */
--len;
}