SunSolve Internal

 

  Simple Search | Advanced Search | Product Search | Tips | Investigation Wizard

 Search for in

Printer Friendly Page ] [ E-mail this Document to Someone ]
Was this document useful? Yes or No ]

Jump to
Infodoc ID   Synopsis   Date
16267   How to make the dtterm title bar dynamic   13 Jan 1998

Description Top
How to make the dtterm title bar dynamic.

This is not controlled by the terminal window itself. It's controlled
by the escape sequences sent to the terminal window. The exact use of the 
escape sequences can be found in the man page for dtterm(5).

There are several examples listed below to do this:

Example 1: (Simple escape sequence to dynamically generate title for dtterm 
             or xterm)

Place the following line in your $HOME/.cshrc file:

  alias cd 'cd \!*;echo $cwd;echo ^[]0\;\(`uname -n`\):$cwd^G'

Now source you .cshrc file.

Example 2: (Expert Level: The below example will work for any window not
            just dtterm and will work across telnets)

1. Place the following in your $HOME/.cshrc:

   #  Set banner for cmdtool
   if ( $TERM == "sun-cmd" || $TERM == "sun" || $TERM == "dtterm") then
      source $HOME/.xbanners
   endif

2. Make sure to REMOVE the following from your $HOME/.cshrc file:

   a.) If you have a "set prompt = ..."
   b.) Any aliases for cd, back, push, pop, or rlogin

3. Add the follow file to your home directory and name it .xbanners:

#  .xbanners -- a file to be sourced if you want to have banners that
#		tell you what machine and where you are for a window.
#
# the header string displays the host and user names, very helpful
# if you log on multiple machines or as different users
setenv HOSTNAME `hostname`
#set headerstring = " $USER @ $HOSTNAME -- "
set headerstring = " $HOSTNAME ($USER) -- "
alias setprompt	set prompt = "$HOSTNAME'% '"
setprompt
set oldcd = `pwd`

alias cd  'set oldcd = `pwd`;chdir \!*;set x = `dirs`;echo -n "]l
           $headerstring $x[1] \";unset x'    #;setprompt'

alias back 'set x = $oldcd;set oldcd = `pwd`;chdir $x;set x = `dirs`;echo -n
            "]l $headerstring $x[1] \";unset x;setprompt'

alias push  'set oldcd = `pwd`;pushd \!*;set x = `dirs`;echo -n "]l
             $headerstring $x[1] \";unset x;setprompt'

alias pop  'set oldcd = `pwd`;popd;set x = `dirs`;echo -n "]l
            $headerstring $x[1] \";unset x;setprompt'

alias rlogin  '/usr/ucb/rlogin \!*;set x = `dirs`;echo -n "]l
               $headerstring $x[1] \";unset x;setprompt'

setenv BANNERS

cd .

SOLUTION SUMMARY:
Product Area Windows
Product CDE
OS Solaris 2.x
Hardware any

Top

SunWeb Home SunWeb Search SunSolve Home Simple Search

Sun Proprietary/Confidential: Internal Use Only
Feedback to SunSolve Team