home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Distributions / ucb / spencer_2bsd.tar.gz / 2bsd.tar / src / reset.c < prev    next >
C/C++ Source or Header  |  1980-02-17  |  427b  |  20 lines

  1. /* Copyright (c) 1979 Regents of the University of California */
  2. /*
  3.  * reset - set the teletype mode bits to be sensible, erase to ^H, kill to @
  4.  *
  5.  * Kurt Shoens
  6.  *
  7.  * Very useful after crapping out in raw.
  8.  */
  9. #include <sgtty.h>
  10.  
  11. main() {
  12.     struct sgttyb buf;
  13.     gtty(2, &buf);
  14.     buf.sg_flags |= XTABS|ECHO|CRMOD|ANYP;
  15.     buf.sg_flags &= ~(RAW|CBREAK|VTDELAY);
  16.     buf.sg_erase = 010;
  17.     buf.sg_kill = '@';
  18.     ioctl(2, TIOCSETN, &buf);
  19. }
  20.