Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jan 2001 21:25:37 +0800
From:      Ariff Abdullah <skywizard@time.net.my>
To:        Wang Peihan <"peihanw@mx.cei.gov.cn"@mx.cei.gov.cn>
Cc:        freebsd-questions@FreeBSD.org
Subject:   Re: xterm title bar and bash prompt
Message-ID:  <01013021295300.01967@FreeBSD.mine.nu>
In-Reply-To: <Pine.WNT.4.32.0101301717040.-302587@wph-notebook>
References:  <Pine.WNT.4.32.0101301717040.-302587@wph-notebook>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01013021295300.01967>