4 ms·
According to stty(1), ”cbreak” is a negative alias of “icanon”, which simply enables the special functions of the ‘erase’ (backspace), ‘kill’ (Ctrl-U), ‘werase’
by teddyh 2y ago
According to stty(1), ”cbreak” is a negative alias of “icanon”, which simply enables the special functions of the ‘erase’ (backspace), ‘kill’ (Ctrl-U), ‘werase’ (Ctrl-W), and ‘rprnt’ (Ctrl-R) keybindings. “cooked” mode includes “icanon”.
So no, I do not think that what you wrote is correct. From what I can tell, the line-by-line mode is “extproc”.
- lilyball 2y agoOn macOS, running `stty cbreak; tr a-zA-Z A-Za-z` causes `tr` to immediately transform every character as it's typed. If I SSH into a linux box that doesn't work, though I'm wondering if that's SSH's fault (it's not convenient right now to get direct access). Certainly the Linux manpage for stty(1) documents a setting min N with -icanon, set N characters minimum for a completed read which suggests that if you set -icanon (e.g. cbreak) then reads may complete after 1 character. Also on macOS the documentation for cbreak is different, it lists a bunch of settings including -icanon, it's Linux that makes it literally an alias for -icanon.