aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/prompt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bin/psql/prompt.c b/src/bin/psql/prompt.c
index 56202bd7681..26592b32872 100644
--- a/src/bin/psql/prompt.c
+++ b/src/bin/psql/prompt.c
@@ -373,7 +373,10 @@ get_prompt(promptStatus_t status, ConditionalStack cstack)
if (visible)
{
chwidth = PQdsplen(p, pset.encoding);
- if (chwidth > 0)
+
+ if (*p == '\n')
+ last_prompt1_width = 0;
+ else if (chwidth > 0)
last_prompt1_width += chwidth;
}