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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Fleming <fleminra(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #11028: psql doesn't use 0x01 and 0x02 to inform readline of non-printable PROMPT1 chars
Date: 2014-07-23 22:38:42
Message-ID: 29814.1406155122@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Robert Fleming <fleminra(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Asif Naeem 2014-07-24 07:59:17 Re: [BUGS] BUG #9652: inet types don't support min/max
Previous Message Robert Fleming 2014-07-23 21:34:59 Re: BUG #11028: psql doesn't use 0x01 and 0x02 to inform readline of non-printable PROMPT1 chars