Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
From: michael-ring@t-online.de (Michael Ring)
To: Jerome Benoit <JGMBenoit@Wanadoo.fr>
Cc: Cygnus <cygwin@sourceware.cygnus.com>
Subject: Re: PS1 and Window title
Date: Tue, 11 Jul 2000 16:45:20 +0200
Message-ID: <tncmms8s8hr0158r1tdf8tpcd9igf022ke@4ax.com>
References: <396B2F89.72734ED5@Wanadoo.fr>
In-Reply-To: <396B2F89.72734ED5@Wanadoo.fr>
X-Mailer: Forte Agent 1.8/32.548
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Sender: 320032306730-0001@t-dialin.net
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id KAA26930

On Tue, 11 Jul 2000 08:30:33 -0600, you wrote:

>Bonjour:
>
>I set `PS1' as
>
>PS1='\e]0;\H:\w\007GENERIC> '
>
>It works fine for small line command.
>But if the line command is to long (higher then half a line)
>strange behaviours happen:
>1] a second line emerges;
>2] the terminal code appears in clear;
>3] the command line editor goes crazy
>Note that the title remains
>
>Any idea ?
>
>Jerome BENOIT

Although you don't see the escape-codes in your prompt they are taken
into account when calculating the length of the current commandline it
seems. I solved the problem in the following way:

xtitle ()
{
        echo -n -e "\033]0;$*\007"
}

if [ "x$TERM" = "xxterm" ]; then
	export PROMPT_COMMAND="xtitle \$USER@\$HOSTNAME"
fi

PS1='\u@\h{\w} '

PROMPT_COMMAND gets executed each time a new prompt-line is generated.

Hope that helped,

Michael Ring

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

