CursorRestore(termw, &screen->sc);
CursorRestore(termw);
restoremodes(XtermWidget termw){	register TScreen	*screen	= &termw->screen;	register int i, j;	for (i = 0; i < nparam; i++) {		switch (param[i]) {		case 1:			/* DECCKM			*/			bitcpy(&termw->keyboard.flags,				screen->save_modes[DP_DECCKM], MODE_DECCKM);			update_appcursor();			break;		case 3:			/* DECCOLM			*/			if(screen->c132) {				ClearScreen(screen);				CursorSet(screen, 0, 0, termw->flags);				if((j = (screen->save_modes[DP_DECCOLM] & IN132COLUMNS)				 ? 132 : 80) != ((termw->flags & IN132COLUMNS)				 ? 132 : 80) || j != screen->max_col + 1)					RequestResize(termw, -1, j, TRUE);				bitcpy(&termw->flags,					screen->save_modes[DP_DECCOLM],					IN132COLUMNS);			}			break;		case 4:			/* DECSCLM (slow scroll)	*/			if (screen->save_modes[DP_DECSCLM] & SMOOTHSCROLL) {				screen->jumpscroll = 0;				if (screen->scroll_amt)					FlushScroll(screen);			} else				screen->jumpscroll = 1;			bitcpy(&termw->flags, screen->save_modes[DP_DECSCLM], SMOOTHSCROLL);			update_jumpscroll();			break;		case 5:			/* DECSCNM			*/			if((screen->save_modes[DP_DECSCNM] ^ termw->flags) & REVERSE_VIDEO) {				bitcpy(&termw->flags, screen->save_modes[DP_DECSCNM], REVERSE_VIDEO);				ReverseVideo(termw);				/* update_reversevideo done in RevVid */			}			break;		case 6:			/* DECOM			*/			bitcpy(&termw->flags, screen->save_modes[DP_DECOM], ORIGIN);			CursorSet(screen, 0, 0, termw->flags);			break;		case 7:			/* DECAWM			*/			bitcpy(&termw->flags, screen->save_modes[DP_DECAWM], WRAPAROUND);			update_autowrap();			break;		case 8:			/* DECARM			*/			/* ignore autorepeat */			break;		case SET_X10_MOUSE:     /* MIT bogus sequence           */			DoRM(DP_X_X10MSE, screen->send_mouse_pos);			break;		case 40:		/* 132 column mode		*/			DoRM(DP_X_DECCOLM, screen->c132);			update_allow132();			break;		case 41:		/* curses hack			*/			DoRM(DP_X_MORE, screen->curses);			update_cursesemul();			break;		case 44:		/* margin bell			*/			if((DoRM(DP_X_MARGIN, screen->marginbell)) == 0)				screen->bellarmed = -1;			update_marginbell();			break;		case 45:		/* reverse wraparound	*/			bitcpy(&termw->flags, screen->save_modes[DP_X_REVWRAP], REVERSEWRAP);			update_reversewrap();			break;#ifdef ALLOWLOGGING		case 46:		/* logging		*/#ifdef ALLOWLOGFILEONOFF			if(screen->save_modes[DP_X_LOGGING])				StartLog(screen);			else				CloseLog(screen);#endif /* ALLOWLOGFILEONOFF */			/* update_logging done by StartLog and CloseLog */			break;#endif		case 1047:		/* alternate buffer */			/* FALLTHRU */		case 47:		/* alternate buffer */			if (!termw->misc.titeInhibit) {			    if(screen->save_modes[DP_X_ALTSCRN])				ToAlternate(screen);			    else				FromAlternate(screen);			    /* update_altscreen done by ToAlt and FromAlt */			}			break;		case SET_VT200_MOUSE:   /* mouse bogus sequence         */		case SET_VT200_HIGHLIGHT_MOUSE:		case SET_BTN_EVENT_MOUSE:		case SET_ANY_EVENT_MOUSE:			DoRM(DP_X_MOUSE, screen->send_mouse_pos);			break;		case 1048:			if (!termw->misc.titeInhibit) {				CursorRestore(termw, &screen->sc);			}			break;		}	}}