#!/bin/csh -f
if ($TERM =~ xterm*) then
	if ($#argv == 0) then
		set argv = $0
		set argv = $argv:t
	endif 
	if (($DISPLAY == :0) || ($DISPLAY == :0.0) || ($DISPLAY == unix:0) || \
		($DISPLAY == unix:0.0)) then
		setenv TERM `hostname`.mit.edu:0
	else if (($DISPLAY == :0.1) || ($DISPLAY == unix:0.1)) then
		setenv TERM `hostname`.mit.edu:0.1
		else		
			setenv TERM $DISPLAY
		endif
	endif
	xhost $argv[1] >& /dev/null
endif
cd /			# don't hold filesystems open
exec rlogin $argv
