Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!ames!haven!adm!smoke!brl.mil!moss From: moss@brl.mil (Gary S. Moss (VLD/VMB) ) Newsgroups: comp.windows.x Subject: Re: Title bar flicker fix for XTerm Keywords: XTerm patch flicker title bar Message-ID: <14003@smoke.BRL.MIL> Date: 3 Oct 90 13:26:41 GMT References: <6459@vanuata.cs.glasgow.ac.uk> <28434@pasteur.Berkeley.EDU> <1990Oct3.011511.2263@mlb.semi.harris.com> Sender: news@smoke.BRL.MIL Reply-To: moss@brl.mil Organization: Ballistic Research Laboratory Lines: 56 In article <1990Oct3.011511.2263@mlb.semi.harris.com>, geg@beep.mlb.semi.harris.com (Greg Garland) writes: |> Better call it something besides 'cd', though, like 'xcd'. I called it 'cd' |> originally, but I noticed that when I ran sunview (to use some non-X stuff) |> the escape sequences seem to cause the SunView 'shelltool's to hang. Well, I have an answer for this one if you use a modern Bourne shell (one with shell functions): # Define functions for labeling window title and icon, where available. case "$TERM" in xterm) case "$BANNER" in console) # BANNER=console xterm -T console -C -ls title_bar() { echo "\033]0;console:$TCWD\007\c"; } icon_name() { echo "\033]1;console\007\c"; } PS1="console$ ";; *) # X window title_bar() { echo "\033]0;$HOST:$TCWD\007\c"; } icon_name() { echo "\033]1;$HOST\007\c"; };; esac;; sun*) case "BANNER" in console) # BANNER=console cmdtool -C title_bar() { echo "\033]lconsole:$TCWD\033\\\\\c"; } icon_name() { echo "\033]Lconsole\033\\\\\c"; } PS1="console$ ";; *) #Suntools window title_bar() { echo "\033]l$HOST:$TCWD\033\\\\\c"; } icon_name() { echo "\033]L$HOST\033\\\\\c"; };; esac;; iris*) case "`tty`" in /dev/console) #Iris console window title_bar() { echo -n "\033P1.yconsole:$TCWD\033\\"; } PS1="console$ ";; *) #Iris window title_bar() { echo -n "\033P1.y$HOST:$TCWD\033\\"; };; esac;; tty5620*) # 5620 myx software title_bar() { myxban -l "$HOST:$TCWD"; myxban -r "$SHELL"; };; tty630*) # 630 layers software title_bar() { echo '\033[?'`expr "$PS1" : '.*'`";2v$PS1\c"; };; *) # other terminals title_bar() { PS1="$HOST:$TCWD$ "; };; esac cd() { PREVDIR="$CWD" # used by backd() case $# in 0) builtin cd;; *) builtin cd "$1";; esac CWD=`pwd` case $CWD in $HOME*) TCWD=`echo $CWD | sed -e "s!^$HOME!~!" `;; *) TCWD=$CWD;; esac title_bar icon_name }