psql: Fix %w length in PROMPT2 when PROMPT1 contains a newline.
authorThomas Munro <tmunro@postgresql.org>
Mon, 10 Feb 2020 00:20:00 +0000 (13:20 +1300)
committerThomas Munro <tmunro@postgresql.org>
Mon, 10 Feb 2020 00:21:26 +0000 (13:21 +1300)
commit1713a0013f909d9ce5dd43d234f1cd33d6a50854
tree45f31e5bf4ddaea8cba36f47cc2a1246afbce3d5
parentc185a57753e64fe3ffc996ea18da8672b302a5a4
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
src/bin/psql/prompt.c