These routines set options within curses that deal with input. The
options involve using ioctl(2) and therefore interact with curses
routines. It is not necessary to turn these options off before
endwin. The routines in this section all return an
These two routines put the terminal into and out of
CBREAK mode, characters typed by the user are
immediately available to the program and erase/kill character
processing is not performed. When in
NOCBREAK mode, the tty driver
will buffer characters typed until a LFD or RET is typed.
Interrupt and flowcontrol characters are unaffected by this mode.
Initially the terminal may or may not be in
CBREAK mode, as it is
inherited, therefore, a program should call
explicitly. Most interactive programs using curses will set
raw. For a discussion of
how these routines interact with
The terminal is placed into or out of
is similar to
CBREAK mode, in that characters typed are
immediately passed through to the user program. The differences are
RAW mode, the interrupt, quit, suspend, and flow control
characters are passed through uninterpreted, instead of generating a
RAW mode also causes 8-bit input and output. The
behavior of the
BREAK key depends on other bits in the terminal
driver that are not set by curses.
These routines control whether characters typed by the user are echoed
read-char as they are typed. Echoing by the tty driver is
always disabled, but initially
read-char is in
so characters typed are echoed. Authors of most interactive programs
prefer to do their own echoing in a controlled area of the screen, or
not to echo at all, so they disable echoing by calling
For a discussion of how these routines interact with
noecho See read-char.
These routines control whether LFD is translated into RET
LFD on output, and whether RET is translated into
LFD on input. Initially, the translations do occur. By disabling
these translations using
nonl, curses is able to make better use
of the linefeed capability, resulting in faster cursor motion.
These routines save and restore the state of the terminal modes.
savetty saves the current state of the terminal in a buffer and
resetty restores the state to what it was at the last call to