🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #1177

Bash: unwanted misfeature; wanted features

#1177
From: Brian Fox
Date: Tue, 27 Feb 1990 23:48
26 lines
1134 bytes
   Date: Tue, 27 Feb 90 15:48:45 EST
   From: karney%SS01.PPPL.GOV@ccc.nmfecc.gov (Charles Karney)
   Reply-To: Karney@ccc.nmfecc.gov

   I'd like to be able to specify a command to be run on every cd, pushd,
   popd.  (So I can put the current directory into the title of my xterm
   window.)


In my .bashrc:

xtitle () { echo -n -e "\033]l$*\033" }
function cd_xtitle () { 
   if [ "$cd_xtitle_pwd" != "$PWD" ]; then
      if [ -z "$tty" ]; then tty=`tty | sed -e s:/dev/ttyp::`; fi
      xtitle "$HOST:$PWD (${tty})"
      cd_xtitle_pwd=$PWD
   fi
}

case $TERM in
   xterm | hpterm)
     PROMPT_COMMAND=cd_xtitle
   ;;
esac
Technical Details
Message-ID: <9002272348.AA00486@sbphy.Ucsb.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!sbphy.ai.mit.edu!bfox
References: <9002272048.AA02528@SS01.PPPL.GOV>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!sbphy.ai.mit.edu!bfox
From: bfox@sbphy.ai.mit.edu (Brian Fox)
Newsgroups: gnu.bash.bug
Subject: Bash: unwanted misfeature; wanted features
Message-ID: <9002272348.AA00486@sbphy.Ucsb.EDU>
Date: 27 Feb 90 23:48:55 GMT
References: <9002272048.AA02528@SS01.PPPL.GOV>
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: bfox@ai.mit.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 26