brewery
notashelf /
0addb42f4f90f76d3aafaf272f12a672c447b226

beer

public

A terminal worth pouring time into

Star0tarball
clone
ssh://git@git.notashelf.dev:33/notashelf/beer.git
crates/beer-protocols/src/lib.rsRust40 lines1.8 KB
1
//! Terminal protocol building blocks for [beer](https://github.com/NotAShelf/beer).
2
//!
3
//! This crate gathers the self-contained pieces of beer's terminal-protocol
4
//! support: the byte codecs an escape stream needs, the terminfo capability
5
//! table, character-set translation, SGR colour/underline parsing, and the
6
//! keyboard/mouse wire encoders. It deliberately holds no terminal state (no
7
//! grid, no parser loop): every item here is a pure function or a plain data
8
//! type, so each protocol detail can be read and tested on its own. beer wires
9
//! these into its `vte`-driven dispatcher and its [`Grid`] model.
10
//!
11
//! The modules map onto the protocols a terminal user cares about:
12
//!
13
//! - [`codec`] - base64 (OSC 52 clipboard), hex (XTGETTCAP), and `file://` URI
14
//!   percent-decoding (OSC 7).
15
//! - [`graphics`] - the kitty graphics protocol APC control-data parse.
16
//! - [`caps`] - the terminfo capabilities answered over XTGETTCAP.
17
//! - [`charset`] - G0/G1 designation and DEC special-graphics line drawing.
18
//! - [`sgr`] - the multi-parameter SGR colour and underline forms.
19
//! - [`key`] - legacy xterm/VT and kitty keyboard-protocol key encoding.
20
//! - [`mouse`] - X10/UTF-8/SGR mouse-report encoding.
21
//! - [`text_size`] - the kitty text-sizing protocol (`OSC 66`) metadata.
22
//! - [`style`] - the enums an SGR/DECSET stream selects (colour, underline,
23
//!   cursor shape, mouse protocol/encoding, shell-integration prompt marks).
24
//!
25
//! See `README.md` for the full inventory of escape sequences, OSC commands,
26
//! and POSIX behaviour beer implements.
27
28
pub mod caps;
29
pub mod charset;
30
pub mod codec;
31
pub mod graphics;
32
pub mod key;
33
pub mod mouse;
34
pub mod sgr;
35
pub mod style;
36
pub mod text_size;
37
38
pub use style::{
39
    Color, CursorShape, MouseEncoding, MouseProtocol, PromptKind, Underline, prompt_kind,
40
};