Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 Cc: Cygnus Subject: Re: PS1 and Window title Date: Tue, 11 Jul 2000 16:45:20 +0200 Message-ID: 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 Content-Type: text/plain; charset=us-ascii X-Sender: 320032306730-0001 AT t-dialin DOT 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 AT sourceware DOT cygnus DOT com