Re: BUG #11028: psql doesn't use 0x01 and 0x02 to inform readline of non-printable PROMPT1 chars - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #11028: psql doesn't use 0x01 and 0x02 to inform readline of non-printable PROMPT1 chars
Date
Msg-id 29814.1406155122@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #11028: psql doesn't use 0x01 and 0x02 to inform readline of non-printable PROMPT1 chars  (Robert Fleming <fleminra@gmail.com>)
Responses Re: BUG #11028: psql doesn't use 0x01 and 0x02 to inform readline of non-printable PROMPT1 chars  (Robert Fleming <fleminra@gmail.com>)
List pgsql-bugs
Robert Fleming <fleminra@gmail.com> writes:
> Yes, sorry, actually it's using libedit. Is that supported?

Ah.  We support libedit, but I'd not be a bit surprised if it does not
cope well with non-printing characters ...

A quick look into the readline.h supplied on my Mac OS X 10.9 machine
(which is from libedit not GNU readline) says that it defines
RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE, so at least in theory
you'd expect it to work.  A bit of experimentation says that it doesn't
work all that well though compared to my Linux box :-(.  Now, Apple has a
long track record of shipping broken versions of libedit, so this doesn't
prove a whole lot about what will happen on other platforms.

I'd make sure that PG was compiled against a version of readline.h that
provided definitions for RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE.
If it was, then whatever misbehavior you're seeing can be blamed on
libedit.  If you're using an old version of libedit it's possible that a
newer one would work better.  But really, libedit is full of inadequacies;
if you can possibly switch to GNU readline you'll probably be happier.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Robert Fleming
Date:
Subject: Re: BUG #11028: psql doesn't use 0x01 and 0x02 to inform readline of non-printable PROMPT1 chars
Next
From: marius.bauer@here.com
Date:
Subject: BUG #11031: Unexpected interval representations