2 /***************************************************************************
4 ****************************************************************************
5 * ncurses is copyright (C) 1992-1995 *
7 * zmbenhal@netcom.com *
9 * esr@snark.thyrsus.com *
11 * Permission is hereby granted to reproduce and distribute ncurses *
12 * by any means and for any fee, whether alone or as part of a *
13 * larger distribution, in source or in binary form, PROVIDED *
14 * this notice is included with any such distribution, and is not *
15 * removed from any of its header files. Mention of ncurses in any *
16 * applications linked with it is highly appreciated. *
18 * ncurses comes AS IS with no warranty, implied or expressed. *
20 ***************************************************************************/
26 ** The routine endwin().
30 #include <curses.priv.h>
33 MODULE_ID("$Id: lib_endwin.c,v 1.10 1997/02/02 00:36:41 tom Exp $")
38 T((T_CALLED("endwin()")));
44 /* SP->_curs{row,col} may be used later in _nc_mvcur_wrap,save_curs */
45 mvcur(-1, -1, SP->_cursrow = screen_lines - 1, SP->_curscol = 0);
47 curs_set(1); /* set cursor to normal mode */
49 if (SP->_coloron == TRUE && orig_pair)
52 _nc_mvcur_wrap(); /* wrap up cursor addressing */
54 if (SP && (SP->_current_attr != A_NORMAL))
58 * Reset terminal's tab counter. There's a long-time bug that
59 * if you exit a "curses" program such as vi or more, tab
60 * forward, and then backspace, the cursor doesn't go to the
61 * right place. The problem is that the kernel counts the
62 * escape sequences that reset things as column positions.
63 * Utter a \r to reset this invisibly.
67 returnCode(reset_shell_mode());