mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
If nnn is started in the picker mode, do NOT use libreadline. Fallback to the stock mechanism to show the command prompt.
This commit is contained in:
parent
543814f5aa
commit
929edaf243
40
src/nnn.c
40
src/nnn.c
|
@ -3888,27 +3888,35 @@ nochange:
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: /* SEL_RUNCMD */
|
default: /* SEL_RUNCMD */
|
||||||
exitcurses();
|
if (cfg.picker)
|
||||||
|
tmp = xreadline(NULL, "> ");
|
||||||
|
else {
|
||||||
|
/* Use libreadline */
|
||||||
|
exitcurses();
|
||||||
|
|
||||||
/* Switch to current path for readline(3) */
|
/* Switch to current path for readline(3) */
|
||||||
if (chdir(path) == -1) {
|
if (chdir(path) == -1) {
|
||||||
printwarn();
|
printwarn();
|
||||||
goto nochange;
|
goto nochange;
|
||||||
|
}
|
||||||
|
|
||||||
|
tmp = readline("nnn> ");
|
||||||
|
|
||||||
|
if (chdir(ipath) == -1) {
|
||||||
|
printwarn();
|
||||||
|
goto nochange;
|
||||||
|
}
|
||||||
|
|
||||||
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = readline("nnn> ");
|
|
||||||
|
|
||||||
if (chdir(ipath) == -1) {
|
|
||||||
printwarn();
|
|
||||||
goto nochange;
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
if (!cfg.picker) {
|
||||||
free(tmp);
|
/* readline finishing touches */
|
||||||
|
add_history(tmp);
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue