[ui] deleting command-prompt char should exit prompt

This commit is contained in:
Timothy Stack 2017-10-18 22:34:55 -07:00
parent d9c42cdc29
commit c8fc0db481
2 changed files with 19 additions and 3 deletions

View File

@ -321,7 +321,13 @@ static int rcFilter(sqlite3_vtab_cursor *pVtabCursor,
const char *pattern = (const char *) sqlite3_value_text(argv[0]);
pCur->c_pattern = pattern;
switch (glob(pattern, GLOB_ERR|GLOB_TILDE, nullptr, pCur->c_glob.inout())) {
switch (glob(pattern,
#ifdef GLOB_TILDE
GLOB_TILDE|
#endif
GLOB_ERR,
nullptr,
pCur->c_glob.inout())) {
case GLOB_NOSPACE:
pVtabCursor->pVtab->zErrMsg = sqlite3_mprintf(
"No space to perform glob()");

View File

@ -78,6 +78,7 @@ static const char *RL_INIT[] = {
* up if it wraps around.
*/
"set horizontal-scroll-mode on",
"set bell-style none",
NULL
};
@ -485,6 +486,17 @@ void readline_curses::start(void)
this->line_ready("");
rl_callback_handler_remove();
}
else if (rl_end == 0) {
if (sendcmd(this->rc_command_pipe[RCF_SLAVE],
'a',
rl_line_buffer,
rl_end) != 0) {
perror("line: write failed");
_exit(1);
}
got_line = 1;
rl_callback_handler_remove();
}
else {
uint64_t h1 = 1, h2 = 2;
@ -740,8 +752,6 @@ void readline_curses::check_poll_set(const vector<struct pollfd> &pollfds)
}
switch (msg[0]) {
case 'a':
require(rc == 1);
this->rc_active_context = -1;
this->vc_past_lines.clear();
this->rc_matches.clear();