mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 13:51:31 +00:00
Fix #219
This commit is contained in:
parent
e76a929710
commit
38fe392c43
17
src/nnn.c
17
src/nnn.c
|
@ -983,20 +983,14 @@ static void spawn(const char *file, const char *arg1, const char *arg2, const ch
|
||||||
arg2 = tmp;
|
arg2 = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flag & F_NORMAL)
|
||||||
|
exitcurses();
|
||||||
|
|
||||||
pid = fork();
|
pid = fork();
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
if (flag & F_NORMAL)
|
|
||||||
exitcurses();
|
|
||||||
|
|
||||||
if (dir != NULL)
|
if (dir != NULL)
|
||||||
status = chdir(dir);
|
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 */
|
/* Suppress stdout and stderr */
|
||||||
if (flag & F_NOTRACE) {
|
if (flag & F_NOTRACE) {
|
||||||
int fd = open("/dev/null", O_WRONLY, 0200);
|
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);
|
DPRINTF_D(pid);
|
||||||
if (flag & F_NORMAL) {
|
if (flag & F_NORMAL) {
|
||||||
exitcurses();
|
|
||||||
initcurses();
|
|
||||||
refresh();
|
refresh();
|
||||||
|
exitcurses();
|
||||||
|
fflush(stdout);
|
||||||
|
initcurses();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue