mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Allow invisible PROMPT2 in psql.
Keep track of the visible width of PROMPT1, and provide %w as a way for PROMPT2 to generate the same number of spaces. Author: Thomas Munro, with ideas from others Reviewed-by: Tom Lane (earlier version) Discussion: https://postgr.es/m/CA%2BhUKG%2BzGd7RigjWbxwhzGW59gUpf76ydQECeGdEdodH6nd__A%40mail.gmail.com
This commit is contained in:
@ -4310,6 +4310,18 @@ testdb=> \set PROMPT1 '%[%033[1;33;40m%]%n@%/%R%[%033[0m%]%# '
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><literal>%w</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Whitespace of the same width as the most recent output of
|
||||
<varname>PROMPT1</varname>. This can be used as a
|
||||
<varname>PROMPT2</varname> setting, so that multi-line statements are
|
||||
aligned with the first line, but there is no visible secondary prompt.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
|
||||
To insert a percent sign into your prompt, write
|
||||
|
Reference in New Issue
Block a user