bmux_terminal_protocol 0.0.1-alpha.1

Shared terminal query/reply protocol engine for bmux
Documentation
  • Coverage
  • 3.03%
    1 out of 33 items documented0 out of 17 items with examples
  • Size
  • Source code size: 31.42 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 921.65 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • BSteffaniak/bmux
    0 0 7
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • BSteffaniak

bmux_terminal_protocol

Terminal query/reply protocol engine for bmux.

Overview

Implements a state machine parser for VT/ANSI escape sequences and manages terminal capability queries and replies. When bmux attaches to a terminal, this engine sends protocol queries (Device Attributes, XTVERSION, etc.) and interprets the replies to build a capability profile. The profile determines which features bmux can use in that terminal.

Features

  • State machine parser for CSI, OSC, DCS, and SOS escape sequences
  • Multiple protocol profiles with different query sets
  • Automatic profile selection based on the TERM environment variable
  • Protocol trace recording for diagnostics (bmux terminal-doctor)
  • Kitty keyboard protocol negotiation (kitty-keyboard feature)

Core Types

  • TerminalProtocolEngine: Main engine that processes output and intercepts query/reply sequences
  • ProtocolProfile: Bmux, Xterm, Screen, or Conservative -- controls which queries are sent
  • ProtocolDirection: Query (bmux -> terminal) or Reply (terminal -> bmux)
  • ProtocolTraceEvent: Timestamped record of a query or reply with decoded details
  • ProtocolTraceBuffer: Ring buffer of trace events for diagnostic output

Usage

use bmux_terminal_protocol::{protocol_profile_for_term, ProtocolProfile};

// Select profile based on TERM value
let profile = protocol_profile_for_term("xterm-256color");
assert_eq!(profile, ProtocolProfile::Xterm);