head	1.2;
access;
symbols
	V1_6_7:1.2
	V1_6_6:1.2
	V1_6_5:1.2
	V1_6_4:1.2
	V1_6_3:1.2;
locks; strict;
comment	@ * @;


1.2
date	2000.03.19.13.38.21;	author vandys;	state Exp;
branches;
next	1.1;

1.1
date	2000.03.17.18.26.04;	author vandys;	state Exp;
branches;
next	;


desc
@Reset window
@


1.2
log
@Use case; saves process spawns
@
text
@#!/vsta/bin/sh
#                        Copyright (c) 1990 Bellcore
#                            All Rights Reserved
#       Permission is granted to copy or use this program, EXCEPT that it
#       may not be sold for profit, the copyright notice must be reproduced
#       on copies, and credit should be given to Bellcore where it is due.
#       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.

#	reset the mgr window state

ESC=""
CLEAR=""
TWENTY="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"

case "$TERM" in
mgr) : ;;
*) echo "$0 only works on mgr terminals" ; exit 1 ;;
esac

#	pop the environment stack a few times
echo -n "${ESC}p${ESC}p${ESC}p${ESC}p${ESC}p"

# clear the events
for i in $TWENTY; do
	echo -n "${ESC}${i}e"
done

# clear some menus
for i in $TWENTY; do
	echo -n "${ESC}${i}m"
done

# clear some bitmaps
for i in $TWENTY; do
	echo -n "${ESC}${i}b"
done

#	reset the window modes (except 8 - bury, and 3 - set)
for i in $TWENTY; do
	case $i in
	3) echo -n "${ESC}${i}S" ;;
	8) : ;;
	*) echo -n "${ESC}${i}s" ;;
	esac
done

# reset the cursor
echo -n "${ESC}0h"

# reset the font
# echo -n "${ESC}F"

# reset the video mode
echo -n "${ESC}n"

# reset the drawing mode (to OR)
echo -n "${ESC}14b"

#	clear the text region
echo -n "${ESC}t"

#	clear the window and home the cursor
echo -n "$CLEAR"

exit 0
@


1.1
log
@Initial revision
@
text
@d15 4
a18 5
if test $TERM != mgr
then
   echo "$0 only works on mgr terminals"
   exit 1
fi
d40 5
a44 7
	if test $i = 3 
		then
		echo -n "${ESC}${i}S"
	elif test $i != 8 
		then
		echo -n "${ESC}${i}s"
	fi
@
