Skip to main content

rmux_core/
lib.rs

1#![forbid(unsafe_code)]
2#![deny(missing_docs)]
3
4//! Pure in-memory RMUX domain model state.
5//!
6//! This crate models sessions, windows, panes, layout geometry, and exact
7//! target resolution without any OS, network, or process integration.
8
9mod box_lines;
10mod buffers;
11pub mod command_parser;
12pub mod command_queue;
13mod dec_modes;
14mod environment;
15/// Bounded event buffers and cursor accounting.
16pub mod events;
17pub mod formats;
18mod glob;
19mod grid;
20mod hooks;
21mod hyperlinks;
22pub mod identity;
23/// tmux-compatible VT parser state machine, CSI/ESC/OSC dispatch, and SGR.
24pub mod input;
25mod keys;
26mod layout;
27mod lifecycle;
28mod options;
29mod pane;
30mod screen;
31mod session;
32pub mod style;
33mod target;
34mod target_find;
35mod terminal;
36mod terminal_passthrough;
37mod terminal_screen;
38mod terminal_sequences;
39pub mod tmux_precedence;
40mod transcript;
41mod utf8;
42mod vis;
43mod window;
44
45pub use box_lines::BoxLines;
46pub use buffers::{BufferStore, BufferView, RenameBufferOutcome, SetBufferOutcome};
47pub use dec_modes::{render_dec_modes, render_dec_modes_for_snapshot};
48pub use environment::{EnvironmentStore, ShowEnvironmentEntry, ENVIRON_HIDDEN};
49pub use formats::format_skip_delimiter;
50pub use grid::GridRenderOptions;
51pub use hooks::{
52    hook_global_root, validate_hook_registration, validate_hook_scope, HookBindingView,
53    HookDispatch, HookGlobalRoot, HookSetOptions, HookStore,
54};
55pub use identity::{PaneId, SessionId, SessionName, WindowId};
56pub use input::{
57    colour_join_rgb, Colour, GridAttr, COLOUR_DEFAULT, COLOUR_FLAG_256, COLOUR_FLAG_RGB,
58    COLOUR_NONE, COLOUR_TERMINAL,
59};
60pub use keys::{
61    key_code_is_mouse_move, key_code_lookup_bits, key_code_to_bytes, key_string_lookup_key,
62    key_string_lookup_string, parse_binding_command_tokens, KeyBinding, KeyBindingDisplay,
63    KeyBindingSortOrder, KeyBindingStore, KeyBindingTable, KeyBindingTableRef, KeyCode, KEYC_ANY,
64    KEYC_BSPACE, KEYC_BUILD_MODIFIERS, KEYC_CTRL, KEYC_CURSOR, KEYC_DRAGGING, KEYC_IMPLIED_META,
65    KEYC_KEYPAD, KEYC_LITERAL, KEYC_MASK_FLAGS, KEYC_MASK_KEY, KEYC_MASK_MODIFIERS, KEYC_MASK_TYPE,
66    KEYC_META, KEYC_NONE, KEYC_SENT, KEYC_SHIFT, KEYC_UNKNOWN, KEYC_USER, KEYC_VI,
67    LIST_KEYS_TEMPLATE,
68};
69pub use lifecycle::LifecycleEvent;
70pub use options::{
71    default_global_scope_for_option_name, option_affects_alerts, option_affects_rendering,
72    option_name_by_name, resolve_option_name, resolve_option_name_typed, validate_option_mutation,
73    validate_option_name_mutation, OptionLookupError, OptionMutationOutcome, OptionNotification,
74    OptionStore, ShowOptionsMode,
75};
76pub use pane::{Pane, PaneGeometry};
77pub use screen::{Screen, ScreenCellRef, ScreenCellView, ScreenLineView};
78pub use session::{
79    BreakPaneOptions, KillPaneOutcome, PaneJoinOptions, PaneSwapOptions, Session,
80    SessionPaneTarget, SessionStore,
81};
82pub use style::{
83    colour_to_string, parse_colour, style_parse, style_tostring, ColourParseError, Style,
84    StyleAlign, StyleCell, StyleDefaultType, StyleList, StyleParseError, StyleRange, StyleWidth,
85};
86pub use target_find::{
87    command_target_metadata, CommandTargetMetadata, CommandTargetSpec, TargetFindContext,
88    TargetFindFlags, TargetFindType, UnresolvedTarget,
89};
90pub use terminal_passthrough::{TerminalPassthrough, TerminalPassthroughKind};
91pub use terminal_screen::TerminalScreen;
92pub use terminal_sequences::{alternate_screen_enter_sequence, alternate_screen_exit_sequence};
93pub use transcript::{ScreenCaptureRange, Transcript};
94pub use utf8::{text_width, truncate_to_width, Utf8Config};
95pub use vis::encode_paste_bytes;
96pub use window::{
97    AlertFlags, Window, WINDOW_ACTIVITY, WINDOW_ALERTFLAGS, WINDOW_BELL, WINDOW_SILENCE,
98    WINLINK_ACTIVITY, WINLINK_ALERTFLAGS, WINLINK_BELL, WINLINK_SILENCE,
99};
100
101/// Returns whether `text` matches the tmux-style glob `pattern`.
102#[must_use]
103pub fn fnmatch(pattern: &str, text: &str) -> bool {
104    glob::fnmatch(pattern, text)
105}