From be9d4f041117da7afa610328f13b7bfddadd12c8 Mon Sep 17 00:00:00 2001 From: Jethro Grassie Date: Thu, 22 Jun 2017 08:15:18 -0400 Subject: Fix multiline wallet cli output with readline monero-wallet-cli commands which have multine output sometimes causes issues with the readline support. This patch fixes show_transfers, payments and incoming_transfers. --- src/simplewallet/simplewallet.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/simplewallet/simplewallet.cpp') diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 4d53f063e..7ef215bf0 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -62,6 +62,15 @@ #include "wallet/wallet_args.h" #include +#ifdef HAVE_READLINE + #include "readline_buffer.h" + #define PAUSE_READLINE() \ + rdln::suspend_readline pause_readline; \ + std::cout << std::endl +#else + #define PAUSE_READLINE() +#endif + using namespace std; using namespace epee; using namespace cryptonote; @@ -1831,6 +1840,8 @@ bool simple_wallet::show_incoming_transfers(const std::vector& args } } + PAUSE_READLINE(); + tools::wallet2::transfer_container transfers; m_wallet->get_transfers(transfers); @@ -1891,6 +1902,8 @@ bool simple_wallet::show_payments(const std::vector &args) LOCK_IDLE_SCOPE(); + PAUSE_READLINE(); + message_writer() << boost::format("%68s%68s%12s%21s%16s") % tr("payment") % tr("transaction") % tr("height") % tr("amount") % tr("unlock time"); @@ -3716,6 +3729,8 @@ bool simple_wallet::show_transfers(const std::vector &args_) std::multimap> output; + PAUSE_READLINE(); + if (in) { std::list> payments; m_wallet->get_payments(payments, min_height, max_height); -- cgit v1.2.3