delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/05/03/14:38:53

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SARE_MSGID_LONG45,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <twig.1272906926.48547@swcp.com>
References: <twig DOT 1272906926 DOT 48547 AT swcp DOT com>
Date: Mon, 3 May 2010 19:38:17 +0100
Message-ID: <h2n416096c61005031138jac81409em6fd1262edae43572@mail.gmail.com>
Subject: Re: $PS1 doesn't appear to work the same after version 1.7
From: Andy Koppe <andy DOT koppe AT gmail DOT com>
To: lynn AT swcp DOT com, cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
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

lynn wrote:
> I use the following to setup my $PS1 bash prompt:
>
> PS1=3D"\[\033]0;\w\007\033[32m\]\u@\h\[\033[36m \W\033[0m\]> "
>
> This attempts to emit the username AT hostname current_folder> =C2=A0(in col=
or)

You've got the \W and the space before it inside \[...\] which tells
readline not to count it towards the length of the prompt. Confusion
ensues.

Andy

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

- Raw text -


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