#!/bin/sh
#
# Copyright(c) 1992 Wimsey Information Technologies
# Stuart Lynne <sl@wimsey.bc.ca>
# Portions adapted from work by Nathaniel Borenstein <nsb@bellcore.com>
# Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore)
#
# Permission to use, copy, modify, and distribute this material 
# for any purpose and without fee is hereby granted, provided 
# that the above copyright notice and this permission notice 
# are included.
#
# WE MAKE NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY 
# OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS", 
# WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
#
#

# This script simply attempts to put terminal driver in single char non
# echo mode, read one char, reset and return that char.


PATH=$PATH:/usr/local/bin:/usr/local/lib/mm

# save terminal state
savetty=`stty -g`

# setup trap to save things
trap 'stty $savetty 2>/dev/null >/dev/null`' 0 1 2 15

# setup for no canonical processing, 1 char min etc
stty -icanon -echo min 1 2>/dev/null > /dev/null

# use dd to read 1 char
dd bs=1 count=1 2>/dev/null

# exit will trap and run cleanup code
exit

