/* * ttresize - recompute the screen dimensions if necessary, and then * adjust pico's internal buffers accordingly. */ void ttresize(void) { int row = -1, col = -1; ttgetwinsz(&row, &col); resize_pico(row, col); }
static int tinfoopen(void) { int row, col; /* * determine the terminal's communication speed and decide * if we need to do optimization ... */ if(ttisslow()) term_capabilities |= TT_OPTIMIZE; col = _tcolumns; row = _tlines; if(row >= 0) row--; ttgetwinsz(&row, &col); term.t_nrow = (short) row; term.t_ncol = (short) col; if(_cleartoeoln != NULL) /* able to use clear to EOL? */ term_capabilities |= TT_EOLEXIST; else term_capabilities &= ~TT_EOLEXIST; if(_setinverse != NULL) term_capabilities |= TT_REVEXIST; else term_capabilities &= ~TT_REVEXIST; if(_deletechar == NULL && (_startdelete == NULL || _enddelete == NULL)) term_capabilities &= ~TT_DELCHAR; if(_insertchar == NULL && (_startinsert == NULL || _endinsert == NULL)) term_capabilities &= ~TT_INSCHAR; if((_scrollregion == NULL || _scrolldown == NULL || _scrollup == NULL) && (_deleteline == NULL || _insertline == NULL)) term_capabilities &= ~TT_SCROLLEXIST; if(_clearscreen == NULL || _moveto == NULL || _up == NULL){ if(Pmaster == NULL){ puts("Incomplete terminfo entry\n"); exit(1); } } ttopen(); if(_termcap_init && !Pmaster) { putpad(_termcap_init); /* any init terminfo requires */ if (_scrollregion) putpad(tgoto(_scrollregion, term.t_nrow, 0)) ; } /* * Initialize UW-modified NCSA telnet to use its functionkeys */ if((gmode & MDFKEY) && Pmaster == NULL) puts("\033[99h"); /* return ignored */ return(0); }