]> Sergey Matveev's repositories - nnn.git/commitdiff
Wait and show command output when running a command
authorArun Prakash Jana <engineerarun@gmail.com>
Sat, 15 Jun 2019 16:17:37 +0000 (21:47 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 15 Jun 2019 16:17:37 +0000 (21:47 +0530)
README.md
src/nnn.c

index aa5b515d7e61bce6dbeba9c985fcd98719d678b0..9503bdf8e0fff55c239aa6e45a36e5fd7cf40b17 100644 (file)
--- a/README.md
+++ b/README.md
@@ -93,7 +93,8 @@ It runs on Linux, macOS, Raspberry Pi, BSD, Cygwin, Linux subsystem for Windows
   - Detailed file information
   - Media information (needs mediainfo/exiftool)
 - Convenience
-  - Plugin repository
+  - Needs minimal configuration
+  - Rich set of plugins
   - Select files across dirs; all/range selection
   - Copy, move, delete, archive, link selection
   - Batch rename selection or dir entries
index db57b618b3c540ba2d986b65c7317ba5dbe2fe7f..cc6541cd455c69d0fba36c802c6e48a769e18cc9 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
 #define F_NOWAIT   0x02  /* don't wait for child process (e.g. file manager) */
 #define F_NOTRACE  0x04  /* suppress stdout and strerr (no traces) */
 #define F_NORMAL   0x08  /* spawn child process in non-curses regular CLI mode */
+#define F_CMD      0x10  /* run command - show results before exit (must have F_NORMAL) */
 
 #define F_CLI      (F_NORMAL | F_MULTI)
 
@@ -1038,8 +1039,14 @@ static int spawn(char *file, char *arg1, char *arg2, const char *dir, uchar flag
                retstatus = join(pid, flag);
 
                DPRINTF_D(pid);
-               if (flag & F_NORMAL)
+               if (flag & F_NORMAL) {
+                       if (flag & F_CMD) {
+                               printf("\nPress Enter to continue");
+                               getchar();
+                       }
+
                        refresh();
+               }
 
                free(cmd);
        }
@@ -4172,7 +4179,7 @@ nochange:
                                }
 #endif
                                if (tmp && tmp[0]) // NOLINT
-                                       spawn(shell, "-c", tmp, path, F_CLI);
+                                       spawn(shell, "-c", tmp, path, F_CLI | F_CMD);
                        }
 
                        /* Continue in navigate-as-you-type mode, if enabled */