Because that raw mode is a bit of an approximation. There's no official definition of raw mode and in practice it means different things for different APIs.
What they meant is that shells like bash
that implement their own line editor disable some of the features of the tty line discipline. In particular, they need to disable the line discipline's own line editor (icanon
setting aka -cbreak
) and local echo
. They don't disable some other line discipline features like the sending of SIGINT upon ^C
(isig
setting).
stty -a
reports the individual discrete termios settings (like those icanon
, echo
, isig
above).
stty
also supports a few aliases to set more than one setting at a time like sane
, cooked
or... raw
.
stty raw
disables all tty line discipline features except echo
. So there are features it disables (like isig
) that bash
doesn't for its line editor and it doesn't disable echo
while bash
does.
The manual of the GNU implementation of stty
describes raw
as being equivalent to -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -icanon -opost -isig -iuclc -ixany -imaxbel -xcase min 1 time 0
. That's the set of discrete termios
settings that stty raw
tweaks (leaving the other ones alone).
Note that opost
is not a stty
alias, it's a discrete tty line discipline setting of its own but it affects all other output post-processing settings like onlcr
, olcuc
. Or in other words onlcr
/olcuc
are ineffective if opost
is not on which explains why stty raw
doesn't bother turning off all those output processing features.
Some systems have cfmakeraw()
/ cfmakesane()
libc functions that can also set more than one setting at once. The cfmakeraw()
of the GNU libc at least is different from GNU's stty raw
in that for instance it disables echo
and doesn't disable iuclc
or ixoff
.