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