From: Arun Prakash Jana Date: Mon, 4 Mar 2019 18:12:01 +0000 (+0530) Subject: Fix #219 X-Git-Tag: v2.4~64 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=38fe392c4377cf5e755a254a9b6c1226048236d8;p=nnn.git Fix #219 --- diff --git a/src/nnn.c b/src/nnn.c index b41b188b..a7b73d4e 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -983,20 +983,14 @@ static void spawn(const char *file, const char *arg1, const char *arg2, const ch arg2 = tmp; } + if (flag & F_NORMAL) + exitcurses(); + pid = fork(); if (pid == 0) { - if (flag & F_NORMAL) - exitcurses(); - if (dir != NULL) status = chdir(dir); - tmp = getenv(env_cfg[NNNLVL]); - - /* Show a marker (to indicate nnn spawned shell) */ - if (flag & F_MARKER && tmp) - fprintf(stdout, "\n +-++-++-+\n | n n n | %d\n +-++-++-+\n\n", xatoi(tmp)); - /* Suppress stdout and stderr */ if (flag & F_NOTRACE) { int fd = open("/dev/null", O_WRONLY, 0200); @@ -1025,9 +1019,10 @@ static void spawn(const char *file, const char *arg1, const char *arg2, const ch DPRINTF_D(pid); if (flag & F_NORMAL) { + refresh(); exitcurses(); + fflush(stdout); initcurses(); - refresh(); } } }