Skip to main content

par_term/
lib.rs

1//! Library exports for testing and potential library use.
2//!
3//! # ARC-011 — Crate Size Note
4//!
5//! The root crate `src/` is ~70,587 lines across ~310 files. This is a compile-time
6//! bottleneck — any change to a single file recompiles the entire crate.
7//!
8//! Planned decomposition (deferred — multi-sprint effort):
9//!
10//!   1. Extract `par-term-ui` crate (~15K lines): egui overlay modules
11//!      - ai_inspector/, clipboard_history_ui, close_confirmation_ui,
12//!        command_history_ui, help_ui, integrations_ui, paste_special_ui,
13//!        profile_drawer_ui, quit_confirmation_ui, remote_shell_install_ui,
14//!        shader_install_ui, ssh_connect_ui, tmux_session_picker_ui
15//!
16//!   2. Extract `par-term-badge` crate (~3K lines): badge.rs + progress_bar.rs
17//!
18//!   3. Extract `par-term-session` crate (~5K lines): session/*, session_logger/
19//!
20//! Tracking: Issue ARC-011 in AUDIT.md.
21//!
22//! # Mutex Usage Policy
23//!
24//! par-term uses three mutex types for different concurrency scenarios.
25//! New code should follow these rules:
26//!
27//! - `tokio::sync::RwLock` — canonical choice for `TerminalManager` and other state
28//!   shared between async tasks and the sync winit event loop. From sync contexts
29//!   use `try_read()` / `try_write()` (non-blocking) or `blocking_read()` /
30//!   `blocking_write()` only for infrequent user-initiated operations. Never call
31//!   the blocking variants from within a Tokio worker thread — it will deadlock.
32//!
33//! - `parking_lot::Mutex` — use for sync-only state where a fast, non-async lock
34//!   is needed (e.g. upload-error field, watcher state). Do NOT call
35//!   `blocking_lock()` on a tokio mutex from within an async context.
36//!
37//! - `std::sync::Mutex` — acceptable for simple, short-lived locks in code that
38//!   cannot depend on parking_lot (e.g. platform FFI modules). Prefer parking_lot
39//!   for new code.
40//!
41//! Canonical Tab-level locking rules are documented on [`tab::Tab`].
42//! See `docs/MUTEX_PATTERNS.md` for detailed patterns, deadlock avoidance rules,
43//! and examples showing correct lock acquisition in each context.
44
45/// Application version (root crate version, for use by sub-crates).
46/// Sub-crates should receive this via parameter rather than using
47/// `env!("CARGO_PKG_VERSION")` which resolves to the sub-crate's version.
48pub const VERSION: &str = env!("CARGO_PKG_VERSION");
49
50#[macro_use]
51pub mod debug;
52
53pub mod acp_harness;
54pub mod ai_inspector;
55pub mod app;
56pub mod arrangements;
57pub mod atomic_save;
58pub mod audio_bell;
59pub mod badge;
60pub mod cli;
61pub mod clipboard_history_ui;
62pub mod close_confirmation_ui;
63pub mod command_history;
64pub mod command_history_ui;
65pub mod config;
66pub mod config_migration;
67pub mod copy_mode;
68pub mod font_metrics;
69pub mod help_ui;
70pub mod http;
71pub mod integrations_ui;
72pub mod macos_blur; // macOS window blur using private CGS API
73pub mod macos_metal; // macOS-specific CAMetalLayer configuration
74pub mod macos_space; // macOS Space (virtual desktop) targeting using private SLS API
75/// MCP server — whole-crate re-export of `par-term-mcp`.
76pub use par_term_mcp as mcp_server;
77pub mod menu;
78pub mod pane;
79pub mod paste_special_ui;
80pub mod paste_transform;
81pub mod platform;
82pub(crate) mod process_timeout;
83pub mod profile;
84pub mod profile_drawer_ui;
85pub mod progress_bar;
86pub mod quit_confirmation_ui;
87pub mod remote_shell_install_ui;
88pub mod scroll_state;
89pub mod search;
90pub mod selection;
91pub mod session;
92pub mod session_logger;
93/// Settings UI — whole-crate re-export of `par-term-settings-ui`.
94pub use par_term_settings_ui as settings_ui;
95pub mod settings_window;
96pub mod shader_install_ui;
97pub mod shader_installer;
98pub mod shader_lint;
99pub mod shader_watcher;
100pub mod shell_integration_installer;
101pub mod shell_quote;
102pub mod smart_selection;
103pub mod snippets;
104pub mod ssh_connect_ui;
105pub mod status_bar;
106pub mod tab;
107pub mod tab_bar_ui;
108/// tmux integration — whole-crate re-export of `par-term-tmux`.
109pub use par_term_tmux as tmux;
110pub mod tmux_session_picker_ui;
111pub mod tmux_status_bar_ui;
112pub mod traits;
113pub mod traits_impl;
114pub mod ui_constants;
115pub mod update_dialog;
116pub mod url_detection;