new argument '-w term_emulator' for specifiying which terminal

emulator to use.  Based on a patch from <arve@nada.kth.se>.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1836 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-06-03 00:55:46 +00:00
parent fe1b022c14
commit 29f2df0170
2 changed files with 17 additions and 12 deletions

View File

@@ -1,7 +1,8 @@
#!/bin/sh
# $Id$
#
usage="Usage: $0 [-l username] [-k] [-t args_to_telnet] [-x args_to_xterm] host [port]"
usage="Usage: $0 [-l username] [-k] [-t args_to_telnet] [-x args_to_xterm] [-w term_emulator] host [port]"
term=
while true
do
case $1 in
@@ -9,6 +10,7 @@ do
-t) telnet_args="${telnet_args} $2 "; shift 2;;
-x) xterm_args="${xterm_args} $2 "; shift 2;;
-k) kx_args="${kx_args} -k"; shift;;
-w) term=$2; shift 2;;
-*) echo "$0: Bad option $1"; echo $usage; exit 1;;
*) break;;
esac
@@ -32,19 +34,20 @@ screen=`echo $DISPLAY | sed -ne 's/[^:]*:[0-9]*\(\.[0-9]*\)/\1/p'`
pid=$1
disp=${2}${screen}
auth=$3
term=
oldifs=$IFS
IFS=:
set -- $PATH
IFS=$oldifs
for i in $*; do
test -n "$i" || i="."
for j in xterm aixterm dxterm hpterm; do
if test -x $i/$j; then
term=$j; break 2
fi
if test -z "$term"; then
for i in $*; do
test -n "$i" || i="."
for j in xterm dtterm aixterm dxterm hpterm; do
if test -x $i/$j; then
term=$j; break 2
fi
done
done
done
fi
if test -n "$term"; then
($term -title $title -name $title $xterm_args -e env DISPLAY=$disp XAUTHORITY=$auth telnet -D $telnet_args $host $port; kill -USR2 $pid) &
else