Add various readline related fixes

- Add missing unbind key
- Fix colored messages
- Add command completion
- Preserve last command input
- Fix cursor position issues
- Fix trailing whitespace in commands
- Synchronize set_prompt
This commit is contained in:
Jethro Grassie 2017-07-07 15:40:32 -04:00
parent 605ad09a3e
commit 6955976b2d
No known key found for this signature in database
GPG key ID: DE8ED755616565BB
4 changed files with 76 additions and 18 deletions

View file

@ -374,6 +374,9 @@ namespace epee
}
else
{
#ifdef HAVE_READLINE
rdln::suspend_readline pause_readline;
#endif
std::cout << "unknown command: " << command << std::endl;
std::cout << usage;
}
@ -477,6 +480,9 @@ namespace epee
lookup::mapped_type & vt = m_command_handlers[cmd];
vt.first = hndlr;
vt.second = usage;
#ifdef HAVE_READLINE
rdln::readline_buffer::add_completion(cmd);
#endif
}
bool process_command_vec(const std::vector<std::string>& cmd)