🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #24874

xterm/tcsh- fast, up-to-date hostname/cwd in icontitle/titlebar

#24874
From: Dan Mosedale
Date: Tue, 23 Jun 1992 21:19
29 lines
1489 bytes
Apologies to those who may have seen this before; my earlier posting
appears to have been hit by cancel forgeries that have been running
around the net during the past few days.

I like to keep my xterm titlebar up-to-date with a string of the form:

hostname:/current/working/directory

and keep the icontitle set to the current hostname.

For those using tcsh, versions 6 and up, here is some code which can
be inserted into your .[t]cshrc file. This method is relatively quick,
as it doesn't require reading any environment variables or forking any
extra processes.

# I've used several if statements to make it easier to insert into the
# already existing structure of your .[t]cshrc file.

if ($?prompt) then
    if ($?tcsh) then  # should probably really test if tcsh version >= 6
    	if ($term == xterm || $term == xterms || $term == xterml) then
    	    set prompt="%{\e]2\;%m:%/^g\e]1\;%m^g\r%}%m %h %# "
    	endif
    endif
endif

Enjoy.

-Dan Mosedale
Technical Details
Message-ID: <1992Jun23.211923.22317@nntp.uoregon.edu>
Path: arc1-ca.pugleaf.net!wupost!uwm.edu!ogicse!news.u.washington.edu!nntp.uoregon.edu!bright!dmose

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!wupost!uwm.edu!ogicse!news.u.washington.edu!nntp.uoregon.edu!bright!dmose
From: dmose@bright.uoregon.edu (Dan Mosedale)
Newsgroups: comp.windows.x,alt.sources
Subject: xterm/tcsh- fast, up-to-date hostname/cwd in icontitle/titlebar
Message-ID: <1992Jun23.211923.22317@nntp.uoregon.edu>
Date: 23 Jun 92 21:19:23 GMT
Article-I.D.: nntp.1992Jun23.211923.22317
Sender: news@nntp.uoregon.edu
Organization: Dept. of Mathematics, University of Oregon, Eugene OR 97403-1222
Lines: 29