From owner-freebsd-questions Tue Jan 30 5:18:10 2001 Delivered-To: freebsd-questions@freebsd.org Received: from FreeBSD.mine.nu (unknown [203.106.101.63]) by hub.freebsd.org (Postfix) with ESMTP id E844E37B6A2 for ; Tue, 30 Jan 2001 05:17:50 -0800 (PST) Received: (from root@localhost) by FreeBSD.mine.nu (8.8.8/8.8.8) id VAA02055; Tue, 30 Jan 2001 21:29:54 +0800 (MYT) (envelope-from root) From: Ariff Abdullah Reply-To: skywizard@time.net.my Organization: FreeBSD 2.2.8-RELEASE To: Wang Peihan <"peihanw@mx.cei.gov.cn"@mx.cei.gov.cn> Subject: Re: xterm title bar and bash prompt Date: Tue, 30 Jan 2001 21:25:37 +0800 X-Mailer: KMail [version 1.0.28] Content-Type: text/plain References: In-Reply-To: Cc: freebsd-questions@FreeBSD.org MIME-Version: 1.0 Message-Id: <01013021295300.01967@FreeBSD.mine.nu> Content-Transfer-Encoding: 8bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 30 Jan 2001, Wang Peihan wrote: > In my ~/.bashrc, there are sections like this > > ### begin ### > if [ $TERM = "xterm" -o $TERM = "xterm-color" -o $TERM = "vt100" ]; then > USER=`whoami` > export USER > HOST=`hostname` > export HOST > PS1='^[]2;${USER}@${HOST}:\w^G$ ' > export PS1 > fi > set -o vi > ### end ### > > So, the title bar of an xterm window looks like > "student@study.bbs.edu.cn:~/prog/cc/work". > > It is cool, but a weird thing happens. The line wrap of bash did not work > properly any more. When typing a long command line, the input line is a > mess. > > Is there any way to correct this? > > (My system is 4.1 stable, bash 2.04) > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message bash 1/2 honour "PROMPT_COMMAND", which evaluated everytime the prompt appear try this:- PROMPT_COMMAND='echo -ne "\033]0;${SHELL} - ${USER}@${HOST}:${PWD}\007"' PS1="\u@\h \W\\$ " export PROMPT_COMMAND PS1 -- +----------------------------------------+ | /\_____ | | / ./__ | | / __/ < I do understand.. | | / ___/ | | / / | | ^^^^^^^^^^^^^^^^^^^^^^ | | *warf* *warf* | | | +----------------------------------------+ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message