delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/07/10/15:05:53

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <048601c58582$58876c80$6508a8c0@chimaera>
From: "Max Bowsher" <maxb AT ukf DOT net>
To: "Cygwin" <cygwin AT cygwin DOT com>
Subject: bash 3.0-7 bug - prompt length with non-printing characters
Date: Sun, 10 Jul 2005 20:05:32 +0100
MIME-Version: 1.0
X-IsSubscribed: yes

I have a prompt ($PS1) which includes non-printing characters. They are 
enclosed with \[ .... \] so that bash knows not to count them in discovering 
the length of the prompt in order to position the cursor correctly.

On upgrading to bash 3, I noticed that the last few characters of my prompt 
were erroneously duplicated (it ended with two $ signs). When tab completion 
was used, the text got nastlily corrupted.

Here is a reproduction case:

PS1='\[\e[32;1m\]@\[\e[33;1m\]#\[\e[0m\] $ '

Curiously, appending '\[\]' to the end of $PS1 works around the problem.

Max.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019