/* Macros to define process spawn behaviour as flags */
 #define F_NONE     0x00  /* no flag set */
-#define F_MARKER   0x01  /* draw marker to indicate nnn spawned (e.g. shell) */
+#define F_MULTI    0x01  /* first arg can be combination of args; to be used with F_NORMAL */
 #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_SIGINT   0x08  /* restore default SIGINT handler */
-#define F_EDITOR   0x10  /* spawn the editor */
-#define F_MULTI    0x20  /* first arg can be combination of args */
-#define F_NORMAL   0x80  /* spawn child process in non-curses regular CLI mode */
+#define F_EDIT     0x10  /* spawn the editor */
+#define F_NORMAL   0x20  /* spawn child process in non-curses regular CLI mode */
+
+#define F_PAGER    (F_NORMAL | F_MULTI)
+#define F_SHELL    (F_NORMAL | F_MULTI | F_SIGINT)
+#define F_EDITOR   (F_NORMAL | F_MULTI | F_EDIT)
 
 /* CRC8 macros */
 #define WIDTH  (sizeof(unsigned char) << 3)
 static char *opener;
 static char *copier;
 static char *editor;
-static char *pager, *pager_arg;
-static char *shell, *shell_arg;
+static char *pager;
+static char *shell;
 static char *home;
 static blkcnt_t ent_blocks;
 static blkcnt_t dir_blocks;
 
        close(fd);
        if (pos && pos == copybufpos)
-               spawn(pager, pager_arg, g_tmpfpath, NULL, F_NORMAL);
+               spawn(pager, g_tmpfpath, NULL, NULL, F_PAGER);
        unlink(g_tmpfpath);
        return TRUE;
 }
                }
 
                xstrlcpy(cmd, file, len);
-               argv[0] = file;
                status = parseargs(cmd, argv);
-               if (status == -1 || status > (EXEC_ARGS_MAX - 2)) { /* arg1 and last NULL */
+               if (status == -1 || status > (EXEC_ARGS_MAX - 3)) { /* arg1, arg2 and last NULL */
                        free(cmd);
                        DPRINTF_S("spawn: NULL or too many args");
                        return;
                }
 
-               argv[status] = arg1;
+               argv[status++] = arg1;
+               argv[status] = arg2;
        } else {
                argv[0] = file;
                argv[1] = arg1;
                DPRINTF_D(pid);
                if (flag & F_NORMAL) {
                        refresh();
-                       if (flag & F_EDITOR) {
+                       if (flag & F_EDIT) {
                                exitcurses();
                                fflush(stdout);
                                initcurses();
                /* Show in pager in child */
                dup2(pipefd[0], STDIN_FILENO);
                close(pipefd[0]);
-               execlp(pager, pager, NULL);
+               spawn(pager, NULL, NULL, NULL, F_PAGER);
                _exit(1);
        }
 
        dprintf(fd, "\n\n");
        close(fd);
 
-       spawn(pager, pager_arg, g_tmpfpath, NULL, F_NORMAL);
+       spawn(pager, g_tmpfpath, NULL, NULL, F_PAGER);
        unlink(g_tmpfpath);
        return TRUE;
 }
        dprintf(fd, "\nv%s\n%s\n", VERSION, GENERAL_INFO);
        close(fd);
 
-       spawn(pager, pager_arg, g_tmpfpath, NULL, F_NORMAL);
+       spawn(pager, g_tmpfpath, NULL, NULL, F_PAGER);
        unlink(g_tmpfpath);
        return TRUE;
 }
                                        xstrlcpy(path, rundir, PATH_MAX);
                                        if (runfile[0]) {
                                                xstrlcpy(lastname, runfile, NAME_MAX);
-                                               spawn(shell, newpath, lastname, path,
-                                                     F_NORMAL | F_SIGINT);
+                                               spawn(shell, newpath, lastname, path, F_SHELL);
                                                runfile[0] = '\0';
                                        } else
-                                               spawn(shell, newpath, NULL, path,
-                                                     F_NORMAL | F_SIGINT);
+                                               spawn(shell, newpath, NULL, path, F_SHELL);
                                        rundir[0] = '\0';
                                        cfg.runscript = 0;
                                        setdirwatch();
                                    get_output(g_buf, CMD_LEN_MAX, "file", FILE_OPTS, newpath, FALSE)
                                    && g_buf[0] == 't' && g_buf[1] == 'e' && g_buf[2] == 'x'
                                    && g_buf[3] == g_buf[0] && g_buf[4] == '/') {
-                                       spawn(editor, newpath, NULL, path,
-                                             F_NORMAL | F_EDITOR | F_MULTI);
+                                       spawn(editor, newpath, NULL, path, F_EDITOR);
                                        continue;
                                }
 
                                r = show_help(path);
                                break;
                        case SEL_RUNEDIT:
-                               spawn(editor, dents[cur].name, NULL, path,
-                                     F_NORMAL | F_EDITOR |F_MULTI);
+                               spawn(editor, dents[cur].name, NULL, path, F_EDITOR);
                                break;
                        case SEL_RUNPAGE:
-                               spawn(pager, pager_arg, dents[cur].name, path, F_NORMAL);
+                               spawn(pager, dents[cur].name, NULL, path, F_PAGER);
                                break;
                        case SEL_NOTE:
                        {
                                        goto nochange;
                                }
 
-                               spawn(editor, notepath, NULL, path, F_NORMAL | F_EDITOR |F_MULTI);
+                               spawn(editor, notepath, NULL, path, F_EDITOR);
                                break;
                        }
                        default: /* SEL_LOCK */
                                spawn(newpath, NULL, NULL, path, F_NORMAL | F_SIGINT);
                                break;
                        case SEL_SHELL:
-                               spawn(shell, shell_arg, NULL, path, F_NORMAL | F_MARKER);
+                               spawn(shell, NULL, NULL, path, F_SHELL);
                                break;
                        case SEL_SCRIPT:
                                if (!scriptpath) {
                                /* Regular script file */
                                if (S_ISREG(sb.st_mode)) {
                                        tmp = ndents ? dents[cur].name : NULL;
-                                       spawn(shell, scriptpath, tmp, path, F_NORMAL | F_SIGINT);
+                                       spawn(shell, scriptpath, tmp, path, F_SHELL);
                                        break;
                                }
 
                        default: /* SEL_RUNCMD */
 #ifndef NORL
                                if (cfg.picker) {
-                                       /* readline prompt breaks the interface, use stock */
 #endif
                                        tmp = xreadline(NULL, "> ");
                                        if (tmp[0])
-                                               spawn(shell, "-c", tmp, path, F_NORMAL | F_SIGINT);
+                                               spawn(shell, "-c", tmp, path, F_SHELL);
 #ifndef NORL
                                } else {
                                        exitcurses();
                                        refresh();
 
                                        if (tmp && tmp[0]) {
-                                               spawn(shell, "-c", tmp, path, F_NORMAL | F_SIGINT);
+                                               spawn(shell, "-c", tmp, path, F_SHELL);
                                                /* readline finishing touches */
                                                add_history(tmp);
                                                free(tmp);
        shell = xgetenv(envs[SHELL], "sh");
        DPRINTF_S(shell);
 
-       if (!getprogarg(pager, &pager_arg) || !getprogarg(shell, &shell_arg)) {
-               fprintf(stderr, "%s\n", messages[STR_ARGLIMIT]);
-               return 1;
-       }
-       DPRINTF_S(pager_arg);
-       DPRINTF_S(shell_arg);
-
        DPRINTF_S(getenv("PWD"));
 
 #ifdef LINUX_INOTIFY