Cooked mode
From Wikipedia, the free encyclopedia
| It has been suggested that cbreak mode be merged into this article or section. (Discuss) |
Cooked mode is a mode of a terminal or pseudo terminal character device in Unix-like systems in which data is preprocessed before being given to a program. In this mode the system interprets special characters such as backspace, delete and other control characters such as Control-C and Control-D. The precise definition of what constitutes a cooked mode is Operating System Specific[1]. The other mode is “raw mode” in which the data is given as-is to the program, the system does not interpret any of the special characters.
For example, if “ABC<Backspace>D” is given as an input to a program through a terminal character device in cooked mode, the program gets “ABD”. But, if the terminal is in raw mode, the program gets the characters “ABC” followed by the Backspace character and followed by “D”. In cooked mode, the terminal line discipline processes the characters “ABC<Backspace>D” and presents only the result (“ABD”) to the program.
Technically, the term “cooked mode” should be associated only with streams that have a terminal line discipline, but generally it is applied to any system that does some amount of preprocessing[2].
[edit] See also
- Rare mode
- Terminal emulator
- Serial communications
- Chapter Serial communications in Linux and Unix of the Serial Data Communications Programming Wikibook
- Command and Data modes

