uncurses/ansi/c0.rs
1//! C0 control bytes (`0x00..=0x1f`).
2//!
3//! ## Category
4//!
5//! C0 controls are the 7-bit single-byte control characters shared with ASCII:
6//! BEL, BS, HT, LF, CR, ESC, and related communication controls.
7//!
8//! ## 7-bit escape conventions
9//!
10//! `ESC` (`0x1b`) introduces 7-bit encodings of higher-level controls such as
11//! CSI (`ESC [`), OSC (`ESC ]`), and DCS (`ESC P`). Those two-byte introducers
12//! are emitted by the writer modules for the sequence family they control; they
13//! are not represented as distinct constants here.
14//!
15//! ## Mode interaction
16//!
17//! Most C0 bytes are mode-independent, though terminals may interpret line-feed
18//! behavior according to line-feed/new-line mode ([`Mode::LINE_FEED_NEW_LINE`](crate::ansi::mode::Mode::LINE_FEED_NEW_LINE)).
19
20/// Null control byte `0x00`; used as a padding or string terminator in some byte protocols.
21pub const NUL: u8 = 0x00;
22/// Start of Heading control byte `0x01`.
23pub const SOH: u8 = 0x01;
24/// Start of Text control byte `0x02`.
25pub const STX: u8 = 0x02;
26/// End of Text control byte `0x03`.
27pub const ETX: u8 = 0x03;
28/// End of Transmission control byte `0x04`.
29pub const EOT: u8 = 0x04;
30/// Enquiry control byte `0x05`; historically asks for terminal identification.
31pub const ENQ: u8 = 0x05;
32/// Acknowledge control byte `0x06`.
33pub const ACK: u8 = 0x06;
34/// Bell control byte `0x07`; also terminates many OSC strings emitted by this crate.
35pub const BEL: u8 = 0x07;
36/// Backspace control byte `0x08`; moves one column left in ordinary terminal output.
37pub const BS: u8 = 0x08;
38/// Horizontal Tab control byte `0x09`; advances to the next tab stop.
39pub const HT: u8 = 0x09;
40/// Line Feed control byte `0x0a`; moves down one line, with carriage behavior depending on terminal mode.
41pub const LF: u8 = 0x0A;
42/// Vertical Tab control byte `0x0b`.
43pub const VT: u8 = 0x0B;
44/// Form Feed control byte `0x0c`.
45pub const FF: u8 = 0x0C;
46/// Carriage Return control byte `0x0d`; moves to the start of the current line.
47pub const CR: u8 = 0x0D;
48/// Shift Out control byte `0x0e`; invokes G1 into GL until shifted back.
49pub const SO: u8 = 0x0E;
50/// Shift In control byte `0x0f`; invokes G0 into GL.
51pub const SI: u8 = 0x0F;
52/// Data Link Escape control byte `0x10`.
53pub const DLE: u8 = 0x10;
54/// Device Control 1 byte `0x11`; commonly XON in software flow control.
55pub const DC1: u8 = 0x11;
56/// Device Control 2 byte `0x12`.
57pub const DC2: u8 = 0x12;
58/// Device Control 3 byte `0x13`; commonly XOFF in software flow control.
59pub const DC3: u8 = 0x13;
60/// Device Control 4 byte `0x14`.
61pub const DC4: u8 = 0x14;
62/// Negative Acknowledge control byte `0x15`.
63pub const NAK: u8 = 0x15;
64/// Synchronous Idle control byte `0x16`.
65pub const SYN: u8 = 0x16;
66/// End of Transmission Block control byte `0x17`.
67pub const ETB: u8 = 0x17;
68/// Cancel control byte `0x18`; often aborts an in-progress escape sequence.
69pub const CAN: u8 = 0x18;
70/// End of Medium control byte `0x19`.
71pub const EM: u8 = 0x19;
72/// Substitute control byte `0x1a`; may also abort an in-progress escape sequence.
73pub const SUB: u8 = 0x1A;
74/// Escape control byte `0x1b`; introduces 7-bit escape sequences such as CSI (`ESC [`) and OSC (`ESC ]`).
75pub const ESC: u8 = 0x1B;
76/// File Separator control byte `0x1c`.
77pub const FS: u8 = 0x1C;
78/// Group Separator control byte `0x1d`.
79pub const GS: u8 = 0x1D;
80/// Record Separator control byte `0x1e`.
81pub const RS: u8 = 0x1E;
82/// Unit Separator control byte `0x1f`.
83pub const US: u8 = 0x1F;
84
85/// Locking Shift 0, alias for [`SI`] (`0x0f`); selects G0 for GL.
86pub const LS0: u8 = SI;
87/// Locking Shift 1, alias for [`SO`] (`0x0e`); selects G1 for GL.
88pub const LS1: u8 = SO;