mirror of
https://github.com/monero-project/monero.git
synced 2025-08-08 12:42:21 -04:00
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.
This commit is contained in:
parent
0c6ea4f8a6
commit
be9d4f0411
2 changed files with 20 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue