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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

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: Thu, 22 Dec 2005 19:24:07 +0100
  • Message-id: <20051222182407.GF5076@piware.de> <text/plain>

Hi!

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
prompt.

Attached patch fixes this. This was investigated and patched by Aaron
Schrab <aaron(at)schrab(dot)com>, full details at http://bugs.debian.org/343616

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

Martin

-- 
Martin Pitt        http://www.piware.de
Ubuntu Developer   http://www.ubuntu.com
Debian Developer   http://www.debian.org

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

Attachment: 12-readline-prompt-ignore.patch
Description: Text document

Attachment: signature.asc
Description: Digital signature



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group