Re: Invisible PROMPT2

From: David Fetter <david(at)fetter(dot)org>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
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:12:16
Message-ID: 20191113181216.GS7444@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 13, 2019 at 03:06:08PM -0300, Alvaro Herrera wrote:
> 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.

So something like %w[...%w] where people could put things like PROMPT1
inside?

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 Mukesh Chhatani 2019-11-13 18:37:30 Re: BUG #16109: Postgres planning time is high across version - 10.6 vs 10.10
Previous Message Alvaro Herrera 2019-11-13 18:06:08 Re: Invisible PROMPT2