+ /*
+ * We should always check the screensize, just in case.
+ */
+ _nc_set_screen(sp);
+ sp->_term = cur_term;
+#ifdef USE_TERM_DRIVER
+ TCBOf(sp)->csp = sp;
+ _nc_get_screensize(sp, sp->_term, &slines, &scolumns);
+#else
+ _nc_get_screensize(sp, &slines, &scolumns);
+#endif
+ SET_LINES(slines);
+ SET_COLS(scolumns);
+
+ T((T_CREATE("screen %s %dx%d"),
+ NCURSES_SP_NAME(termname) (NCURSES_SP_ARG), slines, scolumns));
+
+ sp->_filtered = filtered;
+
+ /* implement filter mode */
+ if (filtered) {
+ slines = 1;
+ SET_LINES(slines);
+#ifdef USE_TERM_DRIVER
+ CallDriver(sp, setfilter);
+#else
+ clear_screen = 0;
+ cursor_down = parm_down_cursor = 0;
+ cursor_address = 0;
+ cursor_up = parm_up_cursor = 0;
+ row_address = 0;
+
+ cursor_home = carriage_return;
+#endif
+ T(("filter screensize %dx%d", slines, scolumns));
+ }
+#ifdef __DJGPP__
+ T(("setting output mode to binary"));
+ fflush(output);
+ setmode(output, O_BINARY);
+#endif
+ NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_ARGx output, TRUE);
+ sp->_lines = slines;
+ sp->_lines_avail = slines;
+ sp->_columns = scolumns;
+ sp->_ofp = output;
+ SP_PRE_INIT(sp);
+ SetNoPadding(sp);
+