Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1713a00

Browse files
committed
psql: Fix %w length in PROMPT2 when PROMPT1 contains a newline.
The width of the invisible PROMPT2 must take into account, in orderfor user input to be aligned with the first line, that PROMPT1 cancontain newlines.Author: Maxence AhloucheReviewed-by: Tom LaneDiscussion:https://postgr.es/m/CAJeaomVyLSP_Wj%3D0FtYNTuoopWHyFarhUtYKDHs0HHv%2Bb%3DN9sA%40mail.gmail.com
1 parentc185a57 commit1713a00

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/bin/psql/prompt.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,10 @@ get_prompt(promptStatus_t status, ConditionalStack cstack)
373373
if (visible)
374374
{
375375
chwidth=PQdsplen(p,pset.encoding);
376-
if (chwidth>0)
376+
377+
if (*p=='\n')
378+
last_prompt1_width=0;
379+
elseif (chwidth>0)
377380
last_prompt1_width+=chwidth;
378381
}
379382

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp