diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2015-12-07 17:18:13 +0100 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2015-12-07 17:33:03 +0100 |
commit | e29b844f42fe5257161d8014fa0e4300035ae386 (patch) | |
tree | 9d9740fb1ff1b7b42c4fe9c95bf875d65b3bd525 | |
parent | 229ea4547cbc9dc9c81b54e4a1a3f8dcf9ff4fcf (diff) | |
download | NetworkManager-e29b844f42fe5257161d8014fa0e4300035ae386.tar.gz |
cli: produce new line after readline when echoing was off
The new line was missing.
Adding termios_new.c_lflag |= (ECHONL | ICANON); did not help. Why?
Fixes: a14306c2cebed02cec73bbf18fa24ee79a66b649
-rw-r--r-- | clients/cli/common.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clients/cli/common.c b/clients/cli/common.c index dd0b8c58dd..427c5247fc 100644 --- a/clients/cli/common.c +++ b/clients/cli/common.c @@ -1198,8 +1198,11 @@ nmc_readline_echo (gboolean echo_on, const char *prompt_fmt, ...) g_free (prompt); /* Restore original terminal settings */ - if (!echo_on) + if (!echo_on) { tcsetattr (STDIN_FILENO, TCSADRAIN, &termios_orig); + /* New line - setting ECHONL | ICANON did not help */ + fprintf (stdout, "\n"); + } return str; } |