1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
#! /bin/sh
# invoke mined in a newly started xterm;
# if name of this script starts with either "u" or "l",
# UTF-8 or Latin-1 operating is configured,
# otherwise the current terminal encoding is inherited
# retrieve X font resource for class UXTerm and use it if available;
# this should actually be achieved with -class UXTerm instead,
# but due to an xterm bug, -e is ignored when -class is used;
# fixed with xterm 162
xtermversion=`xterm -version 2> /dev/null | sed -e 's,.*(\([0-9]*\)).*,\1,' -e t -e d`
if [ 0$xtermversion -ge 162 ]
then uresources="-class UXTerm"
else # work-around for buggy xterm that ignores -e when -class is present
# also for xterm that understands neither -version nor -class
# (e.g. SunOS /usr/openwin/bin/xterm)
uresources=`
xrdb -query |
sed -e ': start' -e '/\\$/ b cont' -e b -e ': cont' -e N -e 'b start' |
sed -e "s,^UXTerm\(.*\),-xrm 'XTerm\1'," -e t -e d
`
fi
debug=
#debug=echo
case "`basename $0`" in
u*) case "$LC_ALL" in
?*) LC_ALL=`echo $LC_ALL | sed -e "s,\..*,,"`.UTF-8;;
*) LC_CTYPE=`echo $LC_CTYPE | sed -e "s,\..*,,"`.UTF-8
export LC_CTYPE;;
esac
$debug eval xterm -u8 +sb $uresources -e mined "$@" &
;;
l*) case "$LC_ALL" in
?*) LC_ALL=`echo $LC_ALL | sed -e "s,\..*,,"`;;
*) LC_CTYPE=`echo $LC_CTYPE | sed -e "s,\..*,,"`
export LC_CTYPE;;
esac
$debug xterm +sb -e mined "$@" &
;;
*) case "${LC_ALL:-$LC_CTYPE}" in
*.UTF-8|*.utf8)
$debug eval xterm -u8 +sb $uresources -e mined "$@" & ;;
*) $debug xterm +sb -e mined "$@" & ;;
esac
esac
|