diff options
author | Thomas Munro <tmunro@postgresql.org> | 2019-11-19 15:17:15 +1300 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2019-11-19 15:56:21 +1300 |
commit | 7f338369ca624ca6c2e4f579623274c88d325bce (patch) | |
tree | e0e1d252b29972dc72b6cbe0a11817f7eeed8da5 /doc/src | |
parent | cec2edfa7859279f36d2374770ca920c59c73dd8 (diff) | |
download | postgresql-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.sgml | 12 |
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=> \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 |