aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2019-11-19 15:17:15 +1300
committerThomas Munro <tmunro@postgresql.org>2019-11-19 15:56:21 +1300
commit7f338369ca624ca6c2e4f579623274c88d325bce (patch)
treee0e1d252b29972dc72b6cbe0a11817f7eeed8da5 /doc/src
parentcec2edfa7859279f36d2374770ca920c59c73dd8 (diff)
downloadpostgresql-7f338369ca624ca6c2e4f579623274c88d325bce.tar.gz
postgresql-7f338369ca624ca6c2e4f579623274c88d325bce.zip
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
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/psql-ref.sgml12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 7789fc61776..a55ca6a2666 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -4310,6 +4310,18 @@ testdb=&gt; \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