src/nnn.c | 11 +++++++---- diff --git a/src/nnn.c b/src/nnn.c index 790e66f15bd5fa3fd88a54a0353836d2a53060de..ec39df61cb68bef77351b1454d307d4395ad5251 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -197,6 +197,7 @@ #define F_MARKER 0x01 /* draw marker to indicate nnn spawned (e.g. shell) */ #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_NORMAL 0x80 /* spawn child process in non-curses regular CLI mode */ /* CRC8 macros */ @@ -1022,9 +1023,11 @@ DPRINTF_D(pid); if (flag & F_NORMAL) { refresh(); - exitcurses(); - fflush(stdout); - initcurses(); + if (flag & F_EDITOR) { + exitcurses(); + fflush(stdout); + initcurses(); + } } } } @@ -1068,7 +1071,7 @@ g_buf[r + 1] = '\0'; } DPRINTF_S(g_buf); - spawn("sh", "-c", g_buf, path, F_NORMAL); + spawn("sh", "-c", g_buf, path, F_NORMAL | F_EDITOR); return TRUE; }