Re: Invisible PROMPT2

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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 18:06:08
Message-ID: 20191113180608.GA24000@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2019-Nov-13, David Fetter wrote:

> On Wed, Nov 13, 2019 at 09:47:01AM -0500, Tom Lane wrote:

> > > 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...?

This seems way too specific to me. I like the "circumfix" directive
better, because it allows one to do more things. I don't have any
immediate use for it, but it doesn't seem completely far-fetched that
there are some.

BTW the psql manual says that %[ and %] were plagiarized from tcsh, but
that's a lie: tcsh does not contain such a feature. Bash does, however.
(I guess not many people read the tcsh manual.)

Neither bash nor tcsh have a feature to return whitespace of anything;
we're in a green field here ISTM.

Álvaro Herrera
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2019-11-13 18:12:16 Re: Invisible PROMPT2
Previous Message Mark Dilger 2019-11-13 18:04:36 Re: Using multiple extended statistics for estimates