/* * This function gets called once, to set up * the terminal channel. */ ttopen() { #ifdef TCCONIO gettextinfo(&tinfo); oldmode = tinfo.currmode; #if TCCONIOMODE textmode(TCCONIOMODE); #endif directvideo = 0; #else register char *tv_stype; char *getenv(), tcbuf[1024], err_str[72]; /* do this the REAL way */ if ((tv_stype = getenv("TERM")) == NULL) { puts("Environment variable TERM not defined!"); exit(1); } if((tgetent(tcbuf, tv_stype)) != 1) { (void) sprintf(err_str, "Unknown terminal type %s!", tv_stype); puts(err_str); exit(1); } #endif /* TCCONIO */ if (ttraw() == FALSE) panic("aborting due to terminal initialize failure"); #ifdef FEPCTRL /* 90.11.26 by K.Takano */ fepmode_init(); #endif }
/* * This function gets called once, to set up the terminal. * On systems w/o TCSASOFT we turn off off flow control, * which isn't really the right thing to do. */ void ttopen(void) { if (!isatty(STDIN_FILENO) || !isatty(STDOUT_FILENO)) panic("standard input and output must be a terminal"); if (ttraw() == FALSE) panic("aborting due to terminal initialize failure"); }