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:
@@ -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
|
||||
|
@@ -1,7 +1,8 @@
|
||||
#!/bin/sh
|
||||
# $Id$
|
||||
#
|
||||
usage="Usage: $0 [-l username] [-k] [-r rsh_args] [-x xterm_args] host"
|
||||
usage="Usage: $0 [-l username] [-k] [-r rsh_args] [-x xterm_args] [-w term_emulator] host"
|
||||
term=xterm
|
||||
while true
|
||||
do
|
||||
case $1 in
|
||||
@@ -9,12 +10,13 @@ do
|
||||
-r) rsh_args="${rsh_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
|
||||
done
|
||||
if test $# -lt 1; then
|
||||
echo "Usage: $0 host [arguments to xterm]"
|
||||
echo "Usage: $0 host [arguments to $term]"
|
||||
exit 1
|
||||
fi
|
||||
host=$1
|
||||
@@ -32,4 +34,4 @@ pid=$1
|
||||
disp=${2}${screen}
|
||||
auth=$3
|
||||
kill -USR1 $pid
|
||||
rsh -n $rsh_args $host "env DISPLAY=$disp XAUTHORITY=$auth xterm -T $title -n $title $xterm_args &"
|
||||
rsh -n $rsh_args $host "env DISPLAY=$disp XAUTHORITY=$auth $term -T $title -n $title $xterm_args &"
|
||||
|
Reference in New Issue
Block a user