Skip to main content

Crate ftui_core

Crate ftui_core 

Source
Expand description

Core: terminal lifecycle, capability detection, events, and input parsing.

§Role in FrankenTUI

ftui-core is the input layer. It owns terminal session setup/teardown, capability probing, and normalized event types that the runtime consumes.

§Primary responsibilities

  • TerminalSession: RAII lifecycle for raw mode, alt-screen, and cleanup.
  • Event: canonical input events (keys, mouse, paste, resize, focus).
  • Capability detection: terminal features and overrides.
  • Input parsing: robust decoding of terminal input streams.

§How it fits in the system

The runtime (ftui-runtime) consumes ftui-core::Event values and drives application models. The render kernel (ftui-render) is independent of input, so ftui-core is the clean bridge between terminal I/O and the deterministic render pipeline.

Modules§

animation
Composable animation primitives.
capability_override
Runtime capability override injection for testing (bd-k4lj.3).
cursor
Cursor save/restore strategy for inline mode robustness.
cx
Capability context (Cx) for cooperative cancellation and deadline propagation.
event
Canonical input/event types.
event_coalescer
Event coalescing for high-frequency input events.
geometry
Geometric primitives.
gesture
Gesture recognition: transforms raw terminal events into semantic events.
glyph_policy
Glyph capability policy (Unicode/ASCII, emoji, and width calibration).
hover_stabilizer
Hover jitter stabilization using CUSUM change-point detection.
inline_mode
Inline Mode Spike: Validates correctness-first inline mode strategies.
input_parser
Input parser state machine.
key_sequence
Key sequence interpreter for multi-key sequences (bd-2vne.2).
keybinding
Keybinding sequence detection and action mapping.
logging
Logging and tracing support.
mux_passthrough
Multiplexer passthrough wrappers for escape sequences.
read_optimized
Read-optimized concurrent stores for read-heavy, write-rare data.
s3_fifo
S3-FIFO cache (bd-l6yba.1): a scan-resistant, FIFO-based eviction policy.
semantic_event
High-level semantic events derived from raw terminal input (bd-3fu8).
terminal_capabilities
Terminal capability detection model with tear-free output strategies.
text_width
Shared display width helpers for layout and rendering.

Macros§

debug
No-op debug macro when tracing is disabled.
debug_span
No-op debug_span macro when tracing is disabled.
error
No-op error macro when tracing is disabled.
error_span
No-op error_span macro when tracing is disabled.
info
No-op info macro when tracing is disabled.
info_span
No-op info_span macro when tracing is disabled.
trace
No-op trace macro when tracing is disabled.
trace_span
No-op trace_span macro when tracing is disabled.
warn
No-op warn macro when tracing is disabled.
warn_span
No-op warn_span macro when tracing is disabled.