Raw mode sends every keystroke directly to the application instead of letting the terminal buffer, preprocess, or echo input. The application gains fine-grained output control, but must implement input handling itself. section 8.4.1
Using raw or cbreak-style input requires several application changes:
- Read one character at a time with read(1), store characters in an internal buffer, and echo them explicitly. section 8.4.1
- Handle editing such as backspace, then coordinate cursor movement and redraw output so asynchronous messages do not overwrite the input line. section 8.4.1
- Choose cbreak mode when control keys such as CTRL-C should remain interpreted by the terminal. section 8.4.1
Interactive asynchronous console
A delay console enters cbreak mode, reads input character by character, stores messages in a bounded deque, and redraws asynchronous output above the persistent input line. The same design supports an asynchronous command-line SQL client.
