Re: Gnome-Terminal : smallf feature request



On Fri, 16 Jul 1999, Warren Young wrote:

> James Henstridge wrote:
> > 
> > Changing the title to your cwd is not too difficult, and does not require
> > any GTK+ programming.  Gnome-terminal understands the standard xterm title
> > changing escape sequence.  So for bash, you might want to set your prompt
> > to this:
> >   PS1="\[\033]0;\u@\h: \w\007\]$PS1"
> > 
> > That will put user, host and directory in the title, and preserve your
> > normal prompt.
> 
> I use the following, which comes from a recent Linux Journal on-line
> article.  Put it in ~/.bashrc:
> 
> function setpromptstring {
>     case $TERM in
>         xterm*)
>             local TITLEBAR="\[\e]0;\u@\h \w\007\]"
>             ;;
>         *)
>             local TITLEBAR=""
>             ;;
>     esac
>     PS1="${TITLEBAR}[\u@\h \W]\$ "
> }
> setpromptstring
> 
> It's a bit more complicated than what James suggests, but it has a few
> advantages.  First, it's not as compact, so you can see the individual
> pieces working.  Second, it uses the entire path for the window caption,
> but a shortened path for the prompt string.  Third, it also works when
> you're logged into a text-only screen, like the console, or a telnet
> session; James' solution will trash your prompt string in those
> situations.

I just put this in my ~/.bashrc, and it trashed my prompt and made it beep
everytime I hit a key. I had to take it out.

-- 
James Green
http://www.cyberstorm.demon.co.uk/
Home of the demon.tech.modems 56k FAQ.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]