ftui_core/lib.rs
1// Forbid unsafe in production; deny (with targeted allows) in tests for env var helpers.
2#![cfg_attr(not(test), forbid(unsafe_code))]
3#![cfg_attr(test, deny(unsafe_code))]
4
5//! Core: terminal lifecycle, capability detection, events, and input parsing.
6//!
7//! # Role in FrankenTUI
8//! `ftui-core` is the input layer. It owns terminal session setup/teardown,
9//! capability probing, and normalized event types that the runtime consumes.
10//!
11//! # Primary responsibilities
12//! - **TerminalSession**: RAII lifecycle for raw mode, alt-screen, and cleanup.
13//! - **Event**: canonical input events (keys, mouse, paste, resize, focus).
14//! - **Capability detection**: terminal features and overrides.
15//! - **Input parsing**: robust decoding of terminal input streams.
16//!
17//! # How it fits in the system
18//! The runtime (`ftui-runtime`) consumes `ftui-core::Event` values and drives
19//! application models. The render kernel (`ftui-render`) is independent of
20//! input, so `ftui-core` is the clean bridge between terminal I/O and the
21//! deterministic render pipeline.
22
23pub mod animation;
24pub mod capability_override;
25pub mod cursor;
26pub mod event;
27pub mod event_coalescer;
28pub mod geometry;
29pub mod gesture;
30pub mod hover_stabilizer;
31pub mod inline_mode;
32pub mod input_parser;
33pub mod key_sequence;
34pub mod keybinding;
35pub mod logging;
36pub mod mux_passthrough;
37pub mod semantic_event;
38pub mod terminal_capabilities;
39pub mod terminal_session;
40
41#[cfg(feature = "caps-probe")]
42pub mod caps_probe;
43
44// Re-export tracing macros at crate root for ergonomic use.
45#[cfg(feature = "tracing")]
46pub use logging::{
47 debug, debug_span, error, error_span, info, info_span, trace, trace_span, warn, warn_span,
48};