#! /bin/sh

# umined [ options ... ] [ files ... ]
# xmined [ options ... ] [ files ... ]

# Invoke mined in a newly started terminal window;
# if name of this script starts with "u", the uterm script is used 
# to enforce a UTF-8 terminal environment;
# otherwise the current terminal encoding is inherited.

#############################################################################
# Select mode and start xterm with mined.

case "`basename $0`" in
u*)	PATH=`dirname $0`:$PATH
	uterm +sb -e mined "$@" &
	;;
*)	case "${LC_ALL:-${LC_CTYPE:-$LANG}}" in
	*.UTF-8|*.utf8)
		PATH=`dirname $0`:$PATH
		uterm +sb -e mined "$@" &
		;;
	*)	case "$TERM" in
		rxvt*)	rxvt +sb -e mined "$@" & ;;
		*)	xterm +sb -e mined "$@" & ;;
		esac;;
	esac
esac
