diff options
author | Jethro Grassie <jtg@xtrabass.com> | 2017-06-20 09:22:55 -0400 |
---|---|---|
committer | Jethro Grassie <jtg@xtrabass.com> | 2017-06-24 07:34:56 -0400 |
commit | fdccf7e6c3a90af62f4979b39227e8ac23f0ecbb (patch) | |
tree | 862035e387bf8a4b6f18180dd45535091e0864ca /contrib/epee/include | |
parent | Merge pull request #2111 (diff) | |
download | monero-fdccf7e6c3a90af62f4979b39227e8ac23f0ecbb.tar.xz |
Add readline improvements
Color prompt now working and no reprompting on exit command.
Diffstat (limited to 'contrib/epee/include')
-rw-r--r-- | contrib/epee/include/console_handler.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/epee/include/console_handler.h b/contrib/epee/include/console_handler.h index bb20faa65..6832f2ea1 100644 --- a/contrib/epee/include/console_handler.h +++ b/contrib/epee/include/console_handler.h @@ -315,7 +315,11 @@ namespace epee if (!m_prompt.empty()) { #ifdef HAVE_READLINE - m_stdin_reader.get_readline_buffer().set_prompt(m_prompt); + std::string color_prompt = "\001\033[1;33m\002" + m_prompt; + if (' ' != m_prompt.back()) + color_prompt += " "; + color_prompt += "\001\033[0m\002"; + m_stdin_reader.get_readline_buffer().set_prompt(color_prompt); #else epee::set_console_color(epee::console_color_yellow, true); std::cout << m_prompt; |