cli: produce new line after readline when echoing was off
authorJiří Klimeš <jklimes@redhat.com>
Mon, 7 Dec 2015 16:18:13 +0000 (17:18 +0100)
committerJiří Klimeš <jklimes@redhat.com>
Mon, 7 Dec 2015 16:33:03 +0000 (17:33 +0100)
The new line was missing.
Adding termios_new.c_lflag |= (ECHONL | ICANON); did not help. Why?

Fixes: a14306c2cebed02cec73bbf18fa24ee79a66b649

clients/cli/common.c

index dd0b8c5..427c524 100644 (file)
@@ -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;
 }