/* * This routine is called by the * "refresh the screen" command to try and resize * the display. The new size, which must be deadstopped * to not exceed the NROW and NCOL limits, it stored * back into "nrow" and "ncol". Display can always deal * with a screen NROW by NCOL. Look in "window.c" to * see how the caller deals with a change. */ void ttresize (void) { setttysize (); /* found in "ttyio.c", */ ttinit(); wrefresh (curscr); }
/* * This function gets called once, to set up * the terminal channel. */ void ttopen (void) { tcgetattr (0, &oldtty); initscr (); /* initialize the curses library */ keypad (stdscr, TRUE); /* enable keyboard mapping */ nonl (); /* tell curses not to do NL->CR/NL on output */ cbreak (); /* take input chars one at a time, no wait for \n */ noecho (); raw (); setttysize (); tcgetattr (0, &newtty); }
/* * This routine is called by the * "refresh the screen" command to try and resize * the display. The new size, which must be deadstopped * to not exceed the NROW and NCOL limits, it stored * back into "nrow" and "ncol". Display can always deal * with a screen NROW by NCOL. Look in "window.c" to * see how the caller deals with a change. */ void ttresize (void) { setttysize (); /* found in "ttyio.c", */ /* ask OS for tty size */ if (nrow < 1) /* Check limits. */ nrow = 1; else if (nrow > NROW) nrow = NROW; if (ncol < 1) ncol = 1; else if (ncol > NCOL) ncol = NCOL; }
/* * This function sets the Ctrl-C check function off. * This is called both by ttopen() above and by spawncli() to * get the current terminal settings and then change them to what * Ng expects. Thus, stty changes done while spawncli() is in effect * will be reflected in Ng. */ ttraw() { inregs.h.ah = 0x30; /* Check MS-DOS version. */ intdos(&inregs, &outregs); dosversion = outregs.h.al; if (dosversion > 1) { inregs.h.ah = 0x33; /* Get BREAK check status. */ inregs.h.al = 0x00; intdos(&inregs, &outregs); breakstat = outregs.h.dl; inregs.h.al = 0x01; /* Set BREAK check status to */ inregs.h.dl = 0x00; /* no BREAK checking. */ intdos(&inregs, &outregs); if (outregs.h.al == 0xff) { return(FALSE); } inregs.h.ah = 0x44; /* Get IOCTRL status. */ inregs.h.al = 0x00; inregs.x.bx = 0x00; /* 0 = stdin. */ intdos(&inregs, &outregs); stdinstat = outregs.h.dl; inregs.x.dx = (outregs.x.dx | 0x0020) & 0x0027; /* raw mode */ inregs.h.al = 0x01; /* Set IOCTRL to raw. */ intdos(&inregs, &outregs); if (outregs.x.cflag != 0x00) { return(FALSE); } } setttysize(); #ifdef IBMPC /* 90.02.23 by S.Yoshida */ assignkey(); getcursor(); /* 91.01.11 Get cursor info. by S.Yoshida */ #endif /* IBMPC */ #ifdef PC9801 /* 90.03.06 by K.Takano */ assignkey(); if (use_metakey) setezkey(); #endif /* PC9801 */ return(TRUE); }