aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/command.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index d66f83d8ba5..9e62e153853 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -4899,6 +4899,14 @@ do_watch(PQExpBuffer query_buf, double sleep)
sigint_interrupt_enabled = false;
}
+ /*
+ * If the terminal driver echoed "^C", libedit/libreadline might be
+ * confused about the cursor position. Therefore, inject a newline
+ * before the next prompt is displayed.
+ */
+ fprintf(stdout, "\n");
+ fflush(stdout);
+
pg_free(title);
return (res >= 0);
}