aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-07-03 12:27:14 +0200
committerRiccardo Spagni <ric@spagni.net>2017-07-03 12:27:14 +0200
commit7995dcff949bfe3116f798fb2c89b7a29bc5e237 (patch)
treee4a81f4094e34f2e98f27022a661faf80bf5ef3e /src
parentMerge pull request #2110 (diff)
parentmonero-wallet-cli: hang on exit in readline code (#2117) (diff)
downloadmonero-7995dcff949bfe3116f798fb2c89b7a29bc5e237.tar.xz
Merge pull request #2112
76043b17 monero-wallet-cli: hang on exit in readline code (#2117) (moneromooo-monero) a73a42a6 monero-wallet-cli: hang on exit in readline code (#2117) (moneromooo-monero) be9d4f04 Fix multiline wallet cli output with readline (Jethro Grassie)
Diffstat (limited to 'src')
-rw-r--r--src/simplewallet/simplewallet.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index 0153c4ffc..221a66e91 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -62,6 +62,15 @@
#include "wallet/wallet_args.h"
#include <stdexcept>
+#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<std::string>& 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<std::string> &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<std::string> &args_)
std::multimap<uint64_t, std::pair<bool,std::string>> output;
+ PAUSE_READLINE();
+
if (in) {
std::list<std::pair<crypto::hash, tools::wallet2::payment_details>> payments;
m_wallet->get_payments(payments, min_height, max_height);