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
CBREAKmode, respectively. In
CBREAKmode, characters typed by the user are immediately available to the program and erase/kill character processing is not performed. When in
NOCBREAKmode, 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
CBREAKmode, as it is inherited, therefore, a program should call
nocbreakexplicitly. 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
RAWmode is similar to
CBREAKmode, in that characters typed are immediately passed through to the user program. The differences are that in
RAWmode, the interrupt, quit, suspend, and flow control characters are passed through uninterpreted, instead of generating a signal.
RAWmode also causes 8-bit input and output. The behavior of the
BREAKkey 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 by
read-charas they are typed. Echoing by the tty driver is always disabled, but initially
ECHOmode, 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
noecho. For a discussion of how these routines interact with
These routines control whether <LFD> is translated into <RET> and
LFDon 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.