diff options
Diffstat (limited to '')
-rw-r--r-- | contrib/epee/include/console_handler.h | 6 | ||||
-rw-r--r-- | contrib/epee/src/readline_buffer.cpp | 7 |
2 files changed, 10 insertions, 3 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; diff --git a/contrib/epee/src/readline_buffer.cpp b/contrib/epee/src/readline_buffer.cpp index 2d17103b3..d38afd296 100644 --- a/contrib/epee/src/readline_buffer.cpp +++ b/contrib/epee/src/readline_buffer.cpp @@ -168,8 +168,11 @@ static int handle_enter(int x, int y) } free(line); - rl_set_prompt(last_prompt.c_str()); - rl_redisplay(); + if(last_line != "exit") + { + rl_set_prompt(last_prompt.c_str()); + rl_redisplay(); + } rl_done = 1; return 0; |