Re: Invisible PROMPT2 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Invisible PROMPT2
Date
Msg-id 5133.1573656421@sss.pgh.pa.us
Whole thread Raw
In response to Re: Invisible PROMPT2  (ilmari@ilmari.org (Dagfinn Ilmari Mannsåker))
Responses Re: Invisible PROMPT2  (David Fetter <david@fetter.org>)
List pgsql-hackers
ilmari@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes:
> Thomas Munro <thomas.munro@gmail.com> writes:
>> From the advanced bikeshedding department: I'd like my psql
>> transcripts to have the usual alignment, but be easier to copy and
>> paste later without having weird prompt stuff in the middle.  How
>> about a prompt format directive %w that means "whitespace of the same
>> width as %/"?  Then you can make set your PROMPT2 to '%w   ' and it
>> becomes invisible:

> That only lines up nicely if %/ is the only variable-width directive in
> PROMPT1.

Yeah, that was my first reaction too.

> How about a circumfix directive (like the existing %[ ... %])
> that replaces everything inside with whitespace, but keeps the width?

Or just define %w as meaning "whitespace of the same width as
PROMPT1".  You couldn't use it *in* PROMPT1, then, but I see
no use-case for that anyway.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: dropdb --force
Next
From: Tomas Vondra
Date:
Subject: Re: Using multiple extended statistics for estimates