Re: Invisible PROMPT2 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Invisible PROMPT2
Date
Msg-id 12786.1574870984@sss.pgh.pa.us
Whole thread Raw
In response to Re: Invisible PROMPT2  (Maxence Ahlouche <maxence.ahlouche@gmail.com>)
Responses Re: Invisible PROMPT2  (Maxence Ahlouche <maxence.ahlouche@gmail.com>)
List pgsql-hackers
Maxence Ahlouche <maxence.ahlouche@gmail.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



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Why JIT speed improvement is so modest?
Next
From: Tomas Vondra
Date:
Subject: Re: Dynamic gathering the values for seq_page_cost/xxx_cost