Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uwm.edu!ux1.cso.uiuc.edu!uiucdcs!carroll From: carroll@cs.uiuc.edu (Alan M. Carroll) Newsgroups: comp.windows.x Subject: Re: Current directory in the title bar.. Message-ID: <1990Dec5.160442.24029@ux1.cso.uiuc.edu> Date: 5 Dec 90 16:04:42 GMT References: <1990Dec5.014338.22560@vicom.com> Sender: news@ux1.cso.uiuc.edu (News) Reply-To: carroll@cs.uiuc.edu (Alan M. Carroll) Distribution: na Organization: Technophiles Inc. - Engineers with Attitude Lines: 37 This is the code that I use under ksh (88d). If you set XTITLE to a value, that will preceed the directory name. This is handy for the console. #!/bin/ksh # XTerm title updating # ] 0 ; string and string will become the title and icon name # ] 1 ; string for icon name only # ] 2 ; string for title name only # The following have been edited to remove raw control characters. To make this # work, replace ^[ with an actual ESCAPE character, and ^G with an actual # control G. XTITLEPRE="^[]2;" XICONPRE="^[]1;" XPOST="^G" unalias cd function CD { \cd $@ PRWD=${PWD##${HOME}} if [ ! "${PRWD}" = "${PWD}" ] ; then PRWD="~$PRWD" fi if [[ "$TERM" = "xterm" && "$NOXTITLE" = "" ]] ; then print -n -r "${XTITLEPRE}${XTITLE}${PRWD}@${HOST}${XPOST}" fi } alias cd=CD -- Alan M. Carroll "It's psychosomatic. You need a lobotomy. Epoch Development Team I'll get a saw." CS Grad / U of Ill @ Urbana ...{ucbvax,pur-ee,convex}!cs.uiuc.edu!carroll