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