Re: Invisible PROMPT2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Maxence Ahlouche <maxence(dot)ahlouche(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: Invisible PROMPT2
Date: 2019-11-27 16:09:44
Message-ID: 12786.1574870984@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Maxence Ahlouche <maxence(dot)ahlouche(at)gmail(dot)com> writes:
> The length of %w should probably be computed starting from the last newline
> in PROMPT1.

Good idea, but I think you need to account for "visible" (ie, if the
newline is inside RL_PROMPT_START_IGNORE, it shouldn't change the width).
It might be best to add logic inside the existing "if (visible)" instead
of making a new top-level case.

Another special case that somebody's likely to whine about is \t, though
to handle that we'd have to make assumptions about the tab stop distance.
Maybe assuming that it's 8 is good enough.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2019-11-27 16:48:21 Re: Dynamic gathering the values for seq_page_cost/xxx_cost
Previous Message Tomas Vondra 2019-11-27 16:05:04 Re: Why JIT speed improvement is so modest?