From fdbed324f781eb57db06e8944af68f5c4144bd73 Mon Sep 17 00:00:00 2001 From: louib Date: Thu, 22 Jun 2017 16:25:24 -0400 Subject: [PATCH] Outputing newline after password prompt. (#659) --- src/cli/PasswordInput.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cli/PasswordInput.cpp b/src/cli/PasswordInput.cpp index 9436f491..16913e95 100644 --- a/src/cli/PasswordInput.cpp +++ b/src/cli/PasswordInput.cpp @@ -63,10 +63,15 @@ void PasswordInput::setStdinEcho(bool enable = true) QString PasswordInput::getPassword() { static QTextStream inputTextStream(stdin, QIODevice::ReadOnly); + static QTextStream outputTextStream(stdout, QIODevice::WriteOnly); setStdinEcho(false); QString line = inputTextStream.readLine(); setStdinEcho(true); + // The new line was also not echoed, but we do want to echo it. + outputTextStream << "\n"; + outputTextStream.flush(); + return line; }