Expand description
§termpulse
Native terminal progress indicators via OSC 9;4 — with smart terminal detection, graceful fallback, throttling, and stall detection.
§Quick Start
use termpulse::Controller;
let mut ctrl = Controller::auto();
ctrl.set(50, "Building");
// ... do work ...
ctrl.done("Complete");§Architecture
termpulse (this crate)
├── Controller — stateful progress management
├── detect — terminal capability detection
├── backend/ — output strategy (osc, ascii, silent)
├── throttle — rate limiting & deduplication
└── estimate — ETA & throughput calculation
termpulse-core (dependency)
└── OSC 9;4 sequence build/parse/sanitize§Design Principles
- Zero-config:
Controller::auto()detects the best backend - Safe by default: Labels are sanitized, percentages clamped
- Graceful degradation: OSC → ASCII → Silent (three-tier fallback)
- No panic: All operations are infallible from the caller’s perspective
- Dependency injection: All I/O is injectable for testing
Re-exports§
pub use detect::Multiplexer;pub use detect::TerminalCapability;
Modules§
- backend
- Output backends for progress indicators.
- detect
- Terminal capability detection.
- estimate
- ETA and throughput estimation.
- throttle
- Throttle and deduplication engine for progress updates.
Structs§
- Controller
- High-level progress controller.
- OscSequence
- A structured OSC 9;4 progress sequence.
Enums§
- Progress
State - Progress indicator state.
- Terminator
- Sequence terminator variant.
Functions§
- find_
sequences - Find all OSC 9;4 sequences in the given text.
- is_
clean - Check if a label string is clean (contains no dangerous characters).
- sanitize_
label - Sanitize a label string for safe inclusion in an OSC 9;4 sequence.
- strip_
sequences - Strip all OSC 9;4 progress sequences from the input bytes.