]> Sergey Matveev's repositories - nnn.git/commitdiff
Support launching cli utility too
authorArun Prakash Jana <engineerarun@gmail.com>
Thu, 6 Dec 2018 19:13:49 +0000 (00:43 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Thu, 6 Dec 2018 19:13:49 +0000 (00:43 +0530)
README.md
nnn.1
src/nnn.c

index 645d4e8987fed752876a8888c75e3b408bc7ee5e..f0644c17089243317d170efa694c593b58d80804 100644 (file)
--- a/README.md
+++ b/README.md
@@ -117,7 +117,7 @@ We need contributors. Please visit the ToDo list.
   - Run custom scripts in the current directory
   - Change directory at exit (*easy* shell integration)
   - Edit file in EDITOR or open in PAGER
-  - GUI app launcher
+  - Application launcher
   - Terminal locker integration
 - Unicode support
 - Highly optimized, static analysis integrated code
@@ -244,7 +244,7 @@ Press <kbd>?</kbd> in `nnn` to see the list anytime.
              ^J  Disk usage            S  Apparent du
               s  Size                  t  Modification time
  MISC
-              o  Launch GUI app    !, ^]  Spawn SHELL in dir
+          !, ^]  Spawn SHELL in dir    o  Launch app
               R  Run custom script     L  Lock terminal
 ```
 
@@ -438,9 +438,13 @@ To get a space-separated list of the file paths in selection, say at the command
 
     cat ~/.nnncp | xargs -0 echo
 
+Set an easy to remember alias:
+
+    alias ncp="cat ~/.nnncp | xargs -0 echo"
+
 To get the list in a file:
 
-    cat ~/.nnncp | xargs -0 echo > out.txt
+    ncp > out.txt
 
 #### cd on quit
 
diff --git a/nnn.1 b/nnn.1
index 17fe6ccc466369c527a3826e60b424fd7f256078..9dc6334008fda03157a681f863b570b2c5427477 100644 (file)
--- a/nnn.1
+++ b/nnn.1
@@ -143,10 +143,10 @@ Toggle sort by time modified
 MISC
 .Pp
 .Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact
-.It Ic o
-Launch a GUI application (takes 2 combined arguments)
 .It Ic \&!, ^]
 Spawn SHELL in current directory (fallback sh)
+.It Ic o
+Launch an application (takes 2 combined arguments)
 .It Ic R
 Run a custom script
 .It Ic L
index e5384bcafe7cfd09288b9828b3e9d47c39a93e42..e634959b53729e3595c1b28adc9816815caa0df3 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -2051,7 +2051,7 @@ static int show_help(char *path)
             "d^J  Disk usage            S  Apparent du\n"
              "es  Size                  t  Modification time\n"
 "1MISC\n"
-             "eo  Launch GUI app    !, ^]  Spawn SHELL in dir\n"
+         "a!, ^]  Spawn SHELL in dir    o Launch app\n"
              "eR  Run custom script     L  Lock terminal\n"};
 
        if (fd == -1)
@@ -3221,13 +3221,13 @@ nochange:
                                goto nochange;
                        }
 
-                       if (sel == SEL_OPEN) {
-                               r = get_input("press 'c' for cli mode");
-                               if (r == 'c')
-                                       r = F_NORMAL;
-                               else
-                                       r = F_NOWAIT | F_NOTRACE;
+                       r = get_input("press 'c' for cli mode");
+                       if (r == 'c')
+                               r = F_NORMAL;
+                       else
+                               r = F_NOWAIT | F_NOTRACE;
 
+                       if (sel == SEL_OPEN) {
                                getprogarg(tmp, &ptr);
                                mkpath(path, dents[cur].name, newpath, PATH_MAX);
                                spawn(tmp, ptr, newpath, path, r);
@@ -3254,7 +3254,7 @@ nochange:
                                        ++ptr;
                                }
 
-                               spawn(tmp, ptr1, ptr2, path, F_NOWAIT | F_NOTRACE);
+                               spawn(tmp, ptr1, ptr2, path, r);
                                break;
                        }