Skip site navigation (1) Skip section navigation (2)

Small bug fix in readline promt handling

From: Martin Pitt <martin(at)piware(dot)de>
To: PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Small bug fix in readline promt handling
Date: 2005-12-22 18:24:07
Message-ID: (view raw or whole thread)
Lists: pgsql-bugs

When using %[ and %] (prompt length ignore area) in .psqlrc's prompt
formats, psql sends a \001 before the actual readline commands
(RL_PROMPT_{START,END}_IGNORE). This is the way bash handles the
shell's PSx format, but it is not a readline command, but a bash
specific quirk.

Example .psqlrc:
\set PROMPT1 '%[%033[0;35m%]%/@%m%R%#%[%033[0;22m%] '

-> not correctly handled, the cursor will be in the middle of the

Attached patch fixes this. This was investigated and patched by Aaron
Schrab <aaron(at)schrab(dot)com>, full details at

Thank you for considering this, and have a merry christmas!


Martin Pitt
Ubuntu Developer
Debian Developer

In a world without walls and fences, who needs Windows and Gates?


pgsql-bugs by date

Next:From: Bruce MomjianDate: 2005-12-22 23:09:49
Subject: Re: [PATCHES] [BUGS] Solaris cc compiler on amd: PostgreSQL does not
Previous:From: Duncan GoodwinDate: 2005-12-22 18:13:55
Subject: Re: BUG #2000: psql does not prompt for password

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group