Expand description
Library exports for testing and potential library use.
§ARC-011 — Crate Size Note
The root crate src/ is ~70,587 lines across ~310 files. This is a compile-time
bottleneck — any change to a single file recompiles the entire crate.
Planned decomposition (deferred — multi-sprint effort):
-
Extract
par-term-uicrate (~15K lines): egui overlay modules- ai_inspector/, clipboard_history_ui, close_confirmation_ui, command_history_ui, help_ui, integrations_ui, paste_special_ui, profile_drawer_ui, quit_confirmation_ui, remote_shell_install_ui, shader_install_ui, ssh_connect_ui, tmux_session_picker_ui
-
Extract
par-term-badgecrate (~3K lines): badge.rs + progress_bar.rs -
Extract
par-term-sessioncrate (~5K lines): session/*, session_logger/
Tracking: Issue ARC-011 in AUDIT.md.
§Mutex Usage Policy
par-term uses three mutex types for different concurrency scenarios. New code should follow these rules:
-
tokio::sync::RwLock— canonical choice forTerminalManagerand other state shared between async tasks and the sync winit event loop. From sync contexts usetry_read()/try_write()(non-blocking) orblocking_read()/blocking_write()only for infrequent user-initiated operations. Never call the blocking variants from within a Tokio worker thread — it will deadlock. -
parking_lot::Mutex— use for sync-only state where a fast, non-async lock is needed (e.g. upload-error field, watcher state). Do NOT callblocking_lock()on a tokio mutex from within an async context. -
std::sync::Mutex— acceptable for simple, short-lived locks in code that cannot depend on parking_lot (e.g. platform FFI modules). Prefer parking_lot for new code.
Canonical Tab-level locking rules are documented on tab::Tab.
See docs/MUTEX_PATTERNS.md for detailed patterns, deadlock avoidance rules,
and examples showing correct lock acquisition in each context.
Re-exports§
pub use par_term_mcp as mcp_server;pub use par_term_settings_ui as settings_ui;pub use par_term_tmux as tmux;
Modules§
- acp_
harness - Reusable components for the
par-term-acp-harnesstest binary. - ai_
inspector - app
- Application module for par-term
- arrangements
- Window arrangement types and manager for saving/restoring window layouts.
- atomic_
save - Crash-safe atomic file writes — re-exported from
par-term-config. - audio_
bell - badge
- Badge system for displaying session information overlays.
- cli
- Command-line interface for par-term.
- clipboard_
history_ ui - close_
confirmation_ ui - Close confirmation dialog for tabs with running jobs.
- command_
history - Persistent command history for fuzzy search.
- command_
history_ ui - Fuzzy command history search overlay UI.
- config
- Terminal configuration management.
- config_
migration - One-time best-effort migration of user data from a legacy config directory
into the canonical XDG location (
Config::config_dir()). - copy_
mode - Vi-style Copy Mode state machine.
- debug
- font_
metrics - CPU-only font metrics calculation for window sizing.
- help_ui
- http
- HTTP client helper with native-tls support.
- integrations_
ui - Combined integrations welcome dialog.
- macos_
blur - macOS window blur using private CGS API
- macos_
metal - macOS-specific CAMetalLayer configuration
- macos_
space - macOS window Space (virtual desktop) targeting using private SLS APIs
- menu
- Menu support for par-term
- pane
- Pane management for split terminal support
- paste_
special_ ui - Paste Special UI - Command palette for text transformations.
- paste_
transform - Paste transformation utilities.
- platform
- Platform abstraction layer for par-term.
- profile
- Profile management for terminal session configurations
- profile_
drawer_ ui - Profile drawer UI using egui
- progress_
bar - Progress bar overlay rendering using egui.
- quit_
confirmation_ ui - Quit confirmation dialog for the application.
- remote_
shell_ install_ ui - Remote shell integration install confirmation dialog.
- scroll_
state - search
- Terminal search functionality.
- selection
- session
- Session state types for save/restore on startup.
- session_
logger - Session logging and recording for terminal sessions.
- settings_
window - Separate settings window for the terminal emulator.
- shader_
install_ ui - Shader installation prompt UI.
- shader_
installer - Shared shader installation logic.
- shader_
lint - Shader linting and readability scoring helpers.
- shader_
watcher - Shader hot reload watcher
- shell_
integration_ installer - Shell integration installation logic.
- shell_
quote - Shell quoting utilities for safe filename handling.
- smart_
selection - Smart selection module for pattern-based text selection.
- snippets
- Snippet variable substitution and insertion engine.
- ssh_
connect_ ui - SSH Quick Connect dialog.
- status_
bar - Status bar system for displaying session and system information.
- tab
- Tab management for multi-tab terminal support
- tab_
bar_ ui - Tab bar UI using egui
- tmux_
session_ picker_ ui - tmux Session Picker UI
- tmux_
status_ bar_ ui - tmux status bar UI using egui
- traits
- Shared trait definitions for par-term components.
- traits_
impl - Concrete implementations of the traits defined in
crate::traits. - ui_
constants - Named constants for UI layout dimensions.
- update_
dialog - Update notification dialog overlay.
- url_
detection
Macros§
- debug_
and_ log_ error - Emit a message to both the custom debug log (at
Errorlevel) and the standardlogcrate atlog::error!level. - debug_
and_ log_ warn - Emit a message to both the custom debug log (at
Errorlevel) and the standardlogcrate atlog::warn!level. - debug_
error - debug_
info - debug_
log - debug_
trace
Constants§
- VERSION
- Application version (root crate version, for use by sub-crates).
Sub-crates should receive this via parameter rather than using
env!("CARGO_PKG_VERSION")which resolves to the sub-crate’s version.