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: 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 19:12:47
Message-ID: 23902.1406142767@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

fleminra(at)gmail(dot)com writes:
> Basically, the colorized prompt suggested in
> http://www.postgresql.org/docs/9.3/static/app-psql.html#APP-PSQL-PROMPTING
> :

> testdb=> \set PROMPT1 '%[%033[1;33;40m%]%n(at)%/%R%[%033[0m%]%# '

> results in strange readline behavior. In that prompt, "%[" should be
> preceded by "%001" and "%]" should be followed by "%002".

Actually, %[ is supposed to expand to \001 and %] is supposed to expand
to \002.

The example seems to work as given for me. Could you be more specific
about what's going wrong for you? Also, are you sure you are really
using GNU readline, and not something else like libedit?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Simon Riggs 2014-07-23 19:46:52 Re: syntax error WITH ORDINALITY
Previous Message David G Johnston 2014-07-23 18:36:04 Re: syntax error WITH ORDINALITY