[X-Unix] Call for bash prompts

Kirk McElhearn kirklists at wanadoo.fr
Sat Feb 21 00:35:35 PST 2004


On 2/21/04 4:27 AM, "Joe Block" <jpb at ApesSeekingKnowledge.net> wrote:

> Well, do you count updating the Terminal.app / X11 xterm window title
> bar in addition to the prompt as making it multiline and complicated?

Well.... Yes and no. Yes, because I've already got that - you can put the
same info in the title bar of a Terminal window under bash following this
hint:

http://www.macosxhints.com/article.php?story=20031015173932306

> 
> # here is the relevant portion of my .bash_profile
> export PS1='[\u@\h:\w]\$ '
> export TITLEBAR='\[\033]0;\u@\h:\w \007\]'
> # Terminal sets TERM_PROGRAM so we can tell it apart from regular VT100
> case "$TERM_PROGRAM" in
>        "Apple_Terminal")PS1="$TITLEBAR$PS1"
> esac
> case "$TERM" in
>        
> "xterm"|"vt100"|"color-xterm"|"xterm-color")PS1="$TITLEBAR$PSRAW"
> esac
> 
> This sets the prompt (and the Terminal window's title bar) to
> 
> [username at hostname:/path/to/cwd]$
> 
> to prevent awkward errors like rebooting the wrong server from the
> command line, or deleting the live configuration files when you think
> you're working on the . If you don't want the full path, just the
> current directory name, replace \w with \W.  Replacing \h with \H will
> put the Rendezvous name in the prompt on Panther.
> 
> Fiddling the title bar is also convenient because it allows you to use
> Terminal's Dock menu to jump straight to the window you want rather
> than guessing, which is important to me because I typically have 6-12
> windows open.

Yes, I agree.

I have been trying to reproduce something you can do in tcsh - you can put
the actual command name in the title bar as well, but it doesn't seem that
this is possible in bash.
 
Kirk
 
        My latest book: How to Do Everything with Mac OS X Panther
                  http://www.mcelhearn.com/htde.html
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 . . . . . . .  kirk at mcelhearn.com | http://www.mcelhearn.com  . . . . . .
 . .  Kirk McElhearn | Chemin de la Lauze | 05600 Guillestre | France  . .



More information about the X-Unix mailing list