Re: Invisible PROMPT2

From: David Fetter <david(at)fetter(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Invisible PROMPT2
Date: 2019-11-13 17:49:20
Message-ID: 20191113174919.GR7444@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 13, 2019 at 09:47:01AM -0500, Tom Lane wrote:
> ilmari(at)ilmari(dot)org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes:
> > Thomas Munro <thomas(dot)munro(at)gmail(dot)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.

+1 for doing it this way. Would it make more sense to error out if
somebody tried to set that in PROMPT1, or ignore it, or...?

Best,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-11-13 18:02:00 Re: [PATCH] Improve AtSubCommit_childXids
Previous Message Ranier Vilela 2019-11-13 17:40:27 RE: [PATCH] Improve AtSubCommit_childXids