]> Sergey Matveev's repositories - nnn.git/commitdiff
Skip shell invocation to run user-scripts
authorArun Prakash Jana <engineerarun@gmail.com>
Sun, 10 Mar 2019 18:27:27 +0000 (23:57 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sun, 10 Mar 2019 18:27:27 +0000 (23:57 +0530)
src/nnn.c
user-scripts/edit.sh [changed mode: 0644->0755]
user-scripts/fzy.sh [changed mode: 0644->0755]
user-scripts/picker.sh [changed mode: 0644->0755]
user-scripts/sxiv.sh [changed mode: 0644->0755]

index fdabfbb7293cf5f7f324d3092048987fa4ce8f1c..bc414d2cefb820c9a86a57c59aa17003e7bacb3d 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3036,13 +3036,15 @@ nochange:
                                                continue;
 
                                        mkpath(path, dents[cur].name, newpath);
+                                       /* Copy to path so we can return back to earlier dir */
                                        xstrlcpy(path, rundir, PATH_MAX);
                                        if (runfile[0]) {
                                                xstrlcpy(lastname, runfile, NAME_MAX);
-                                               spawn(shell, newpath, lastname, path, F_SHELL);
+                                               spawn(newpath, lastname, NULL, path,
+                                                     F_NORMAL | F_SIGINT);
                                                runfile[0] = '\0';
                                        } else
-                                               spawn(shell, newpath, NULL, path, F_SHELL);
+                                               spawn(newpath, NULL, NULL, path, F_NORMAL | F_SIGINT);
                                        rundir[0] = '\0';
                                        cfg.runscript = 0;
                                        setdirwatch();
@@ -3807,7 +3809,7 @@ nochange:
                                /* Regular script file */
                                if (S_ISREG(sb.st_mode)) {
                                        tmp = ndents ? dents[cur].name : NULL;
-                                       spawn(shell, scriptpath, tmp, path, F_SHELL);
+                                       spawn(scriptpath, tmp, NULL, path, F_NORMAL | F_SIGINT);
                                        break;
                                }
 
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)