mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 20:01:27 +00:00
Change dir before readline()
This commit is contained in:
parent
d47be4e89b
commit
2669278a31
14
src/nnn.c
14
src/nnn.c
|
@ -3709,8 +3709,22 @@ nochange:
|
||||||
break;
|
break;
|
||||||
default: /* SEL_RUNCMD */
|
default: /* SEL_RUNCMD */
|
||||||
exitcurses();
|
exitcurses();
|
||||||
|
|
||||||
|
/* Switch to current path for readline(3) */
|
||||||
|
if (chdir(path) == -1) {
|
||||||
|
printwarn();
|
||||||
|
goto nochange;
|
||||||
|
}
|
||||||
|
|
||||||
tmp = readline("nnn> ");
|
tmp = readline("nnn> ");
|
||||||
|
|
||||||
|
if (chdir(ipath) == -1) {
|
||||||
|
printwarn();
|
||||||
|
goto nochange;
|
||||||
|
}
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
|
|
||||||
if (tmp && tmp[0]) {
|
if (tmp && tmp[0]) {
|
||||||
spawn(shell, "-c", tmp, path, F_NORMAL | F_SIGINT);
|
spawn(shell, "-c", tmp, path, F_NORMAL | F_SIGINT);
|
||||||
add_history(tmp);
|
add_history(tmp);
|
||||||
|
|
Loading…
Reference in a new issue