def_prog_mode, def_shell_mode, reset_prog_mode or reset_shell_mode Subroutine
Purpose
Saves/restores the program or shell terminal modes.
Library
Curses Library (libcurses.a)
Syntax
#include <curses.h>
int def_prog_mode
(void);
int def_shell_mode
(void);
int reset_prog_mode
(void);
int reset_shell_mode
(void);
Description
The def_prog_mode subroutine saves the current terminal modes as the "program" (in Curses) state for use by the reset_prog_mode subroutine.
The def_shell_mode subroutine saves the current terminal modes as the "shell" (not in Curses) state for use by the reset_shell_mode subroutine.
The reset_prog_mode subroutine restores the terminal to the "program" (in Curses) state.
The reset_shell_mode subroutine restores the terminal to the "shell" (not in Curses) state.
These subroutines affect the mode of the terminal associated with the current screen.
Return Values
Upon successful completion, these subroutines return OK. Otherwise, they return ERR.
Examples
For the def_prog_mode subroutine:
To save the "in curses" state, enter:
def_prog_mode();
For the def_shell_mode subroutine:
To save the "out of curses" state, enter:
def_shell_mode();
This routine saves the "out of curses" state.