Skip to main content

devela/sys/os/term/line/
input.rs

1// devela/src/sys/os/term/line/input.rs
2//
3//! Terminal line input modes.
4//
5
6#[doc = crate::_tags!(term interaction)]
7/// How terminal input is delivered to an application.
8#[doc = crate::_doc_meta!{location("sys/os/term")}]
9///
10/// This is a semantic line-discipline request. Backends apply it through their
11/// native terminal state machinery, such as Linux termios.
12#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
13pub enum TermLineMode {
14    /// Line-buffered terminal input. This is the default.
15    #[default]
16    Line,
17
18    /// Event-oriented input with normal terminal behavior mostly preserved.
19    Event,
20
21    /// Raw byte-oriented input with most terminal processing disabled.
22    Raw,
23}
24
25#[allow(non_upper_case_globals)]
26impl TermLineMode {
27    /// Traditional name for [`Line`](Self::Line).
28    pub const Cooked: Self = Self::Line;
29
30    /// Traditional name for [`Event`](Self::Event).
31    pub const Cbreak: Self = Self::Event;
32}