+#ifdef USE_TERM_DRIVER
+ TERMINAL_CONTROL_BLOCK *TCB;
+#else
+ SP_PARM = CURRENT_SCREEN;
+#endif
+ assert(SP_PARM != 0);
+ cols = *(ptrCols(SP_PARM));
+#ifdef USE_TERM_DRIVER
+ TCB = (TERMINAL_CONTROL_BLOCK *) new_term;
+ TCB->csp = SP_PARM;
+#endif
+ numlab = NumLabels;
+
+ /*
+ * In setupterm() we did a set_curterm(), but it was before we set
+ * CURRENT_SCREEN. So the "current" screen's terminal pointer was
+ * overwritten with a different terminal. Later, in
+ * _nc_setupscreen(), we set CURRENT_SCREEN and the terminal
+ * pointer in the new screen.
+ *
+ * Restore the terminal-pointer for the pre-existing screen, if
+ * any.
+ */
+ if (current)
+ current->_term = its_term;
+