Skip to main content

tmux_client/
lib.rs

1//! A typed, asynchronous client for tmux.
2//!
3//! `tmux-client` invokes the tmux command-line protocol directly. It does not
4//! start a runtime, invoke a shell, or make dropping an object destructive.
5//!
6//! ```no_run
7//! use tmux_client::{NewSession, Server};
8//!
9//! # async fn example() -> tmux_client::Result<()> {
10//! let server = Server::new();
11//! let session = server
12//!     .new_session(NewSession::new().name("example")?.detached(true))
13//!     .await?;
14//! assert_eq!(session.name().map(|name| name.as_str()), Some("example"));
15//! # Ok(())
16//! # }
17//! ```
18
19#![forbid(unsafe_code)]
20#![warn(missing_docs, rustdoc::broken_intra_doc_links)]
21
22mod advanced;
23mod buffer;
24mod client;
25mod command;
26mod error;
27mod formats;
28mod options;
29mod pane;
30#[cfg(feature = "query")]
31pub mod query;
32mod server;
33mod session;
34mod snapshot;
35mod target;
36#[cfg(feature = "test-support")]
37pub mod test_support;
38mod text;
39mod version;
40mod window;
41
42pub use advanced::{
43    ClientPermission, CommandPrompt, ConfirmBefore, DisplayMessage, HookScope, IfShell, KeyBinding,
44    Menu, MenuItem, Popup, PromptType, RunShell, ServerAccess, UnbindKey, WaitAction,
45};
46pub use buffer::{Buffer, BufferName};
47pub use client::{AttachedClient, Client};
48pub use command::{Command, CommandResult, CommandSummary};
49pub use error::{Error, ObjectKind, OptionErrorKind, Result};
50pub use formats::{
51    DecodedType, FormatDescriptor, FormatScope, FormatToken, FormatValue, NativeFilter,
52    format_catalog, format_descriptor,
53};
54pub use options::{OptionMap, OptionScope, OptionValue, SparseOptionMap};
55pub use pane::{
56    CaptureLine, CapturePane, ChooseTree, CopyMode, FindWindow, NewPane, Pane, PaneDestination,
57    PaneSize, PasteBuffer, PipePane, RelocatePane, ResizeDirection, RespawnPane, SelectPane,
58    SendKeys, SplitDirection, SplitPane, SwapPane, SwapPaneDirection, TreeSort,
59};
60pub use server::{ColorMode, NewSession, Server, ServerBuilder, ServerConfig, Socket};
61pub use session::Session;
62pub use snapshot::{ClientSnapshot, PaneSnapshot, SessionSnapshot, SnapshotFields, WindowSnapshot};
63pub use target::{
64    ClientName, PaneId, PaneTarget, SessionId, SessionName, SessionTarget, WindowId, WindowLink,
65    WindowTarget,
66};
67pub use text::TmuxText;
68pub use version::{ReleaseVersion, TmuxVersion};
69pub use window::{
70    Layout, NewWindow, RespawnWindow, Rotation, Window, WindowPosition, WindowResize,
71};