1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! Terminal abstraction layer for cross-platform terminal handling.
//!
//! This module provides a unified interface for terminal operations across different
//! platforms (Windows, macOS, Linux). It handles raw mode, mouse tracking, screen
//! buffers, input polling, and rendering.
//!
//! # Architecture
//!
//! The terminal module is organized into several sub-modules:
//!
//! - **control**: Runtime controls and state management
//! - **detection**: Terminal capability detection (colors, Unicode support, etc.)
//! - **frame_buffer**: Double-buffered frame storage for efficient rendering
//! - **input**: Non-blocking input polling for keyboard and mouse events
//! - **renderer**: High-level terminal renderer with overlay support
//! - **screen**: Alternate screen buffer management (enter/exit raw mode)
//! - **signal**: Signal handling for graceful shutdown (Ctrl+C, SIGTERM)
//! - **state**: Runtime state and control types
//! - **timing**: Frame timing and FPS synchronization
//!
//! # Example
//!
//! ```rust,no_run
//! use tslime::terminal::screen::TerminalScreen;
//! use tslime::terminal::{enable_mouse_tracking, disable_mouse_tracking};
//!
//! // Create and setup terminal screen
//! let mut screen = TerminalScreen::new();
//! screen.setup().unwrap();
//!
//! // Enable mouse tracking
//! enable_mouse_tracking().unwrap();
//!
//! // ... run your application ...
//!
//! // Cleanup
//! disable_mouse_tracking().unwrap();
//! screen.teardown().unwrap();
//! ```
/// Runtime controls and state management.
/// Terminal capability detection.
/// Frame buffer for terminal rendering.
/// Input handling (keyboard/mouse).
/// Terminal renderer with overlay support.
/// Alternate screen buffer management.
/// Signal handling (Ctrl+C, resize).
/// Runtime state and control types.
/// Frame timing and synchronization.
use ;
/// Enables mouse tracking in the terminal.
///
/// Sends ANSI escape codes to enable:
/// - Any event tracking (1003)
/// - SGR extended coordinates (1006)
/// - URXVT extended coordinates (1015)
/// Disables mouse tracking in the terminal.
///
/// Sends ANSI escape codes to disable the tracking modes enabled by `enable_mouse_tracking`.