delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/07/11/10:43:28

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: michael-ring AT t-online DOT de (Michael Ring)
To: Jerome Benoit <JGMBenoit AT Wanadoo DOT fr>
Cc: Cygnus <cygwin AT sourceware DOT cygnus DOT com>
Subject: Re: PS1 and Window title
Date: Tue, 11 Jul 2000 16:45:20 +0200
Message-ID: <tncmms8s8hr0158r1tdf8tpcd9igf022ke@4ax.com>
References: <396B2F89 DOT 72734ED5 AT Wanadoo DOT fr>
In-Reply-To: <396B2F89.72734ED5@Wanadoo.fr>
X-Mailer: Forte Agent 1.8/32.548
MIME-Version: 1.0
X-Sender: 320032306730-0001 AT t-dialin DOT net
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 AT sourceware DOT cygnus DOT com

- Raw text -


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