From 18f7a8e262f00ddadc7f34b603e15d02ecb44096 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 20 Jan 2004 19:49:34 +0000 Subject: This is a patch to support readline prompts which contain non-printing characters, as for fancy colorized prompts. This was nearly a direct lift from bash-2.05b's lib/readline/display.c, per guidance from Chet Ramey. Reece Hart --- doc/src/sgml/ref/psql-ref.sgml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 58aa40e72ab..50ea0c910ee 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -1,5 +1,5 @@ @@ -2315,6 +2315,28 @@ testdb=> \set content '\'' `sed -e "s/'/\\\\\\'/g" < my_file.txt` '\' + + %[ ... %] + + + Prompts may contain terminal control characters which, for + example, change the color, background, or style of the prompt + text, or change the title of the terminal window. In order for + the line editing features of readline to work properly, these + non-printing control characters must be designated as invisible + by surrounding them with %[ and + %]. Multiple pairs of these may occur within + the prompt. For example, + +testdb=> \set PROMPT1 '%[%033[1;33;40m%]%n@%/%R%[%033[0m%#%] ' + + results in a boldfaced (1;) yellow-on-black + (33;40) prompt on VT100-compatible, color-capable + terminals. + + + + To insert a percent sign into your prompt, write -- cgit v1.2.3