psql: Fix %w length in PROMPT2 when PROMPT1 contains a newline.

Thomas Munro <tmunro@postgresql.org>

Commit: 1713a0013f909d9ce5dd43d234f1cd33d6a50854
Author: Thomas Munro <tmunro@postgresql.org>
Date: 2020-02-10T00:21:26Z
Releases: 13.0
psql: Fix %w length in PROMPT2 when PROMPT1 contains a newline.

The width of the invisible PROMPT2 must take into account, in order
for user input to be aligned with the first line, that PROMPT1 can
contain newlines.

Author: Maxence Ahlouche
Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/CAJeaomVyLSP_Wj%3D0FtYNTuoopWHyFarhUtYKDHs0HHv%2Bb%3DN9sA%40mail.gmail.com

Files

PathChange+/−
src/bin/psql/prompt.c modified +4 −1

Discussion