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:
Arun Prakash Jana 2019-02-10 09:58:13 +05:30
parent 543814f5aa
commit 929edaf243
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -3888,6 +3888,10 @@ nochange:
} }
break; break;
default: /* SEL_RUNCMD */ default: /* SEL_RUNCMD */
if (cfg.picker)
tmp = xreadline(NULL, "> ");
else {
/* Use libreadline */
exitcurses(); exitcurses();
/* Switch to current path for readline(3) */ /* Switch to current path for readline(3) */
@ -3904,13 +3908,17 @@ 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);
if (!cfg.picker) {
/* readline finishing touches */
add_history(tmp); add_history(tmp);
free(tmp); free(tmp);
} }
} }
}
/* Continue in navigate-as-you-type mode, if enabled */ /* Continue in navigate-as-you-type mode, if enabled */
if (cfg.filtermode) if (cfg.filtermode)