Subject: Re: FVWM: Window title for xterm

From: Danny Sung <[email-masked]>
Date: Thu, 16 May 1996 15:35:37 -0700

>> Is it possible to change the title/iconname of a xterm-window dynamically 
>> to show the name of the process running in the foreground if such one exists 
>> or if such one does not exist the current directory ?

>Below is a snippet from a TCL script I use to set the title of each new xterm I
>create.  The key is the ESC sequences...

Here's mine...

#!/bin/csh -f
#
# Sets the title bar of an xterm
# (My addition)

if( $?term ) then
	if( $term == "xterm" ) then
		echo -n "]2;`hostname`:`pwd`"
	endif
endif

And I use the following in my .cshrc, which gives me prompts suitable for
both text terminals and X terms:

alias a alias
a ll 'ls -lFa'
a pd pushd

a setprompt 'set prompt="$user@$host `dirs` \! > "'

a pushd 'pushd \!:* ; setprompt'
a popd 'popd ; setprompt'
a cd 'cd \!:* ; setprompt'
a telnet 'telnet \!:* ; setprompt'
a rlogin 'rlogin \!:* ; setprompt'

# doesn't work properly on Linux and some other systems
# so, we make the aliases to call setprompt directly
if( $?TERM ) then
	if( $TERM == "xterm" || $TERM == "xterms" ) then
		unalias setprompt
		a setprompt 'set prompt="$user@$host \! > " ; /usr/bin/pwdtitle '
		if( $?SHELL ) then
		  if( `basename $SHELL` == "tcsh" ) then
		    a setprompt 'set prompt="%n@%m#%l %h %?%# "; /usr/bin/pwdtitle'
		  endif
		endif

	endif
endif

setprompt

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].