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

Re: setting dynamic rxvt titles with Xresoures/Xdefaults



"Jens B. Jorgensen" <jjorgens@bdsinc.com> writes:

[snip]

> with your user name, current directory, etc. then what you need to do is use the bash
> PROMPT_COMMAND. bash runs the contents of this variable each time the prompt is
> printed (you could achieve similar effect using the PS1 variable). Here's a snip from
> a .bash_profile to get you started:
> 
> if [ "$TERM" = "xterm" -o "$TERM" = "xterm-color" -o \
>      "$TERM" = "rxvt"  -o "$TERM" = "vs100" ]
> then
>    HOST=`hostname`
>    USER=${USER:-$(whoami)}
>    export PROMPT_COMMAND='echo -ne "\033]0;$HOST($USER):$PWD\007"'
> fi
> 
> What's that? You don't run bash? If you don't run bash I don't know how to make your
> shell do this. With ksh you should be able to get things working using the PS1
> variable.

As you seem pretty knowledgeable with bash usage, I have a question:

In my .bashrc I have:

PS1='\u@\h:\w \$ '

So I get a prompt including a tilde in the prompt when the current
directory is under my home directory, ie ~/foo instead of
/home/broult/foo

Do you know how I can get the same behavior with the command you just
written for the PROMPT_COMMAND variable?

Thank you,

Chris

-- 
// Chris Broult http://www.info.unicaen.fr/lpv


--  
Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null


Reply to: