From 7ed5ab47ea05900250e72bafb11d0e0fc3d180b9 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Fri, 11 Aug 2017 13:38:18 +0100 Subject: scoped_message_writer: pause readline to match simplewallet --- src/common/scoped_message_writer.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/common') diff --git a/src/common/scoped_message_writer.h b/src/common/scoped_message_writer.h index e31f8f0b2..804e9dbdf 100644 --- a/src/common/scoped_message_writer.h +++ b/src/common/scoped_message_writer.h @@ -31,6 +31,14 @@ #include "misc_log_ex.h" #include +#ifdef HAVE_READLINE + #include "readline_buffer.h" + #define PAUSE_READLINE() \ + rdln::suspend_readline pause_readline; +#else + #define PAUSE_READLINE() +#endif + namespace tools { @@ -99,6 +107,7 @@ public: } else { + PAUSE_READLINE(); set_console_color(m_color, m_bright); std::cout << m_oss.str(); epee::reset_console_color(); -- cgit v1.2.3 From e499ff3322fd46b1107681184dac300fcc7dbebd Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Fri, 11 Aug 2017 13:38:42 +0100 Subject: simplewallet: factor out message_writer --- src/common/scoped_message_writer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common') diff --git a/src/common/scoped_message_writer.h b/src/common/scoped_message_writer.h index 804e9dbdf..8fc98d2b0 100644 --- a/src/common/scoped_message_writer.h +++ b/src/common/scoped_message_writer.h @@ -117,9 +117,9 @@ public: } }; -inline scoped_message_writer success_msg_writer() +inline scoped_message_writer success_msg_writer(bool color = true) { - return scoped_message_writer(epee::console_color_green, false, std::string(), el::Level::Info); + return scoped_message_writer(color ? epee::console_color_green : epee::console_color_default, false, std::string(), el::Level::Info); } inline scoped_message_writer msg_writer(epee::console_colors color = epee::console_color_default) -- cgit v1.2.3