#! /bin/sh
#
#	mw - initiate a research-style mux window on the 630
#
#	mw [prog]
#
#	where	prog is the file to be loaded (called from New window only)

case $# in
0)	prog=/usr/630/mbin/mw.m;;
	# hack to extract some interesting stty modes. This is V10-dependent.
	# first, extract current `nl' and `echo' settings...
	
	resettty=`stty | sed -n 4p | cut -f3,4 -d" "`
	
	# now, some characters of interest to the mux window (this is
	# a _real_ kludge: mw.m doesn't know if we change it after
	# this because it is not a terminal driver.)
	
	chars=`	stty		|
		tr ';' '\012'	|
		sed -e "/ = /!d
			s/[ ]*\([a-z]*\) = \(.*\)/\1 \2/"`
1)	prog="$1";;
*)	echo "usage: $0 [mw term]"
esac

	
dmdld $prog $chars

trap 'stty $resettty' 0 3 13 15
stty -echo
exec sh
