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

Re: Bug in tar?



Michael Meskes <meskes@topsystem.de> writes:

[Michael or Mark: If one of you gets this through the list, could you
send me email saying so?  I'm trying to determine if the lists are
down, or if I was dropped -- Thanks]

> Yes, that's it. Silly me, I was experimenting with a modified cd command
> that changes the titel bar of my xterm. Argh!

A better way to manage this (more reliable and safer) is to use bash's
PROMPT_COMMAND variable (assuming that you use bash).  It also won't
be confused by things that change state (like your pwd) underneath you
without the use of cd (i.e. aliases, scripts, etc).

>From my .bashrc (sets the titlebar of an xterm or rxvt to
user@host:pwd, with "~" substitution if appropriate):

if [ ${PS1:-UNSET} = UNSET ]
then
	INTERACTIVE_SHELL=F
else
	INTERACTIVE_SHELL=T

  if [ "$TERM" = x"term" ]
  then
    set -a
    set_titlebar () { echo -n "]2;$*"; }

    my_dirname () { 
      if [ "${PWD#$HOME}" != "$PWD" ]
      then
    	  echo '~'${PWD#$HOME}
      else
    	  echo $PWD
      fi
    }
    export PS1='\n\!\$ '
	  PROMPT_COMMAND='eval set_titlebar `whoami`@`hostname`:`my_dirname`'
	  set +a
  else
    export PS1='\n\u@\h:\w\n\!\$ '
  fi 
fi

--
Rob


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: