- if (_nc_setupscreen(LINES, COLS, ofp, filter_mode, slk_format) == ERR) {
+
+ /* allow user to set maximum escape delay from the environment */
+ if ((value = _nc_getenv_num("ESCDELAY")) >= 0) {
+#if USE_REENTRANT
+ SP->_ESCDELAY = value;
+#else
+ ESCDELAY = value;
+#endif
+ }
+
+ if (_nc_setupscreen(LINES,
+ COLS,
+ ofp,
+ _nc_prescreen.filter_mode,
+ slk_format) == ERR) {