# libtmux for Rust > The Rust port of libtmux (libtmux). Every code sample below is Rust; the same pages exist for the other seven ports under their own prefix. ## Concepts - [Concepts](https://libtmux.org/en/rs/latest/concepts/): tmux objects, command transports, queries, and workspaces across the libtmux language ports. - [Server, session, window, pane](https://libtmux.org/en/rs/latest/concepts/server-session-window-pane/): The object hierarchy every libtmux port mirrors from tmux itself, and the client that sits outside it. - [Control mode vs one-shot](https://libtmux.org/en/rs/latest/concepts/transports/): How a call in your program actually reaches the tmux server, and why a port might give you a choice. - [Filtering and queries](https://libtmux.org/en/rs/latest/concepts/queries/): How you get from every session on the server to the one pane you mean, and what happens when zero or several match. - [Workspaces](https://libtmux.org/en/rs/latest/concepts/workspaces/): Build pane layouts with the object API or a workspace configuration file. ## Examples - [Examples](https://libtmux.org/en/rs/latest/examples/): Programs for sending input, capturing output, and building workspaces in each language. - [Attach and send keys](https://libtmux.org/en/rs/latest/examples/attach-and-send-keys/): Get a session handle, send a command to a pane, and capture output. - [Capture pane output](https://libtmux.org/en/rs/latest/examples/capture-pane-output/): Capture a pane's screen and wait for expected output or a completion signal. - [Build a workspace from a file](https://libtmux.org/en/rs/latest/examples/workspace-from-file/): The tmuxp-shaped job of describing a multi-window session as data and building it in one call, in each port that has a checked way to do it. ## Guides - [Guides](https://libtmux.org/en/rs/latest/guides/): Task-oriented walkthroughs that sit between the concepts and each port's own API reference. - [Getting started](https://libtmux.org/en/rs/latest/guides/getting-started/): Install tmux, pick a port, and run the smallest thing that proves your setup works. - [Attaching to tmux](https://libtmux.org/en/rs/latest/guides/attaching-to-tmux/): What a plain constructor call actually connects to, and how to find a session that might already exist instead of always creating a new one. - [Sending keys](https://libtmux.org/en/rs/latest/guides/sending-keys/): Literal text versus tmux key names, whether Enter is pressed for you, and why a command can outrun the shell about to run it. - [Capturing output](https://libtmux.org/en/rs/latest/guides/capturing-output/): Read a pane's screen or scrollback and wait for output or a completion signal. - [Filtering and querying, in practice](https://libtmux.org/en/rs/latest/guides/querying-and-filtering/): Filter tmux objects, require one match, and choose where a query runs. - [Testing with libtmux](https://libtmux.org/en/rs/latest/guides/testing-with-libtmux/): Every port ships a way to give your own tests a real, disposable tmux server. What each one hands you, and what it guarantees about cleanup. ## Internals - [Rust workspace internals](https://libtmux.org/en/rs/latest/workspace/internals/): Architecture and development interfaces of the Rust workspace builder. - [Rust workspace builder behavior](https://libtmux.org/en/rs/latest/workspace/internals/topics/): Internal configuration, application, and failure contracts of the Rust workspace builder. - [Use the Rust workspace builder](https://libtmux.org/en/rs/latest/workspace/internals/guides/): Use the in-development Rust workspace builder from application code. - [Rust workspace builder examples](https://libtmux.org/en/rs/latest/workspace/internals/examples/): Internal examples for building and inspecting workspaces through the Rust API. - [Rust workspace builder API](https://libtmux.org/en/rs/latest/workspace/reference/): Internal reference for the Rust workspace builder and configuration APIs. ## Overview - [Third-party notices](https://libtmux.org/en/rs/latest/third-party-notices/): Licences and attribution for the tools that build libtmux.org and the software libtmux depends on. ## Rust MCP - [MCP for Rust](https://libtmux.org/en/rs/latest/mcp/): Run tmux-mcp or embed its typed tool surface in a Rust application. - [Rust MCP topics](https://libtmux.org/en/rs/latest/mcp/topics/): Select toolsets, inspect the pinned endpoint, and observe bounded commands. - [Connect a Rust MCP client](https://libtmux.org/en/rs/latest/mcp/guides/): Install tmux-mcp, select a socket explicitly, and verify the chosen tool selection. - [Rust MCP examples](https://libtmux.org/en/rs/latest/mcp/examples/): List sessions through the Rust MCP server and inspect implementation examples. - [Rust MCP API](https://libtmux.org/en/rs/latest/mcp/reference/): Find TmuxTools, tool selections, schema-bearing registrations, and MCP resources. ## Rust Workspace Manager - [Workspace Manager for Rust (in development)](https://libtmux.org/en/rs/latest/workspace/): The Rust workspace manager is unfinished; builder APIs are available, but there is no workspace loader CLI. ## Topics - [Topics](https://libtmux.org/en/rs/latest/topics/): Object traversal, cleanup, pane I/O, configuration, and failure handling. - [Architecture](https://libtmux.org/en/rs/latest/topics/architecture/): The object hierarchy underneath the API you call, and who actually holds the behavior in each port. - [Traversal](https://libtmux.org/en/rs/latest/topics/traversal/): Moving up and down the server/session/window/pane tree, and the two questions that come up once you have more than one object. - [Context managers](https://libtmux.org/en/rs/latest/topics/context-managers/): Scope-based cleanup for tmux objects, and when your program must kill them explicitly. - [Pane interaction](https://libtmux.org/en/rs/latest/topics/pane-interaction/): Input defaults, screen capture, and waiting for a command to finish. - [Options and hooks](https://libtmux.org/en/rs/latest/topics/options-and-hooks/): Reading and writing tmux's own configuration knobs, and binding commands to its events, at whichever scope you're holding. - [Format-token fields](https://libtmux.org/en/rs/latest/topics/format-tokens/): The typed fields every object exposes, mirroring tmux's own format tokens, and why a field is sometimes absent. - [Waiting and retrying](https://libtmux.org/en/rs/latest/topics/waiting-and-retry/): Polling a condition instead of guessing a sleep, and tmux's own wait-for signal channel as the alternative to polling. - [Environment](https://libtmux.org/en/rs/latest/topics/environment/): Locate tmux objects from process variables and manage the environment inherited by new panes. - [Socket and servers](https://libtmux.org/en/rs/latest/topics/socket-and-servers/): How a port names one specific tmux server among several, checks whether it's actually there, and tells one running instance apart from another. - [Errors and exceptions](https://libtmux.org/en/rs/latest/topics/errors-and-exceptions/): What a failed tmux command becomes in each port, and the question every one of them has to answer before letting you retry it. ## Reference - [Rust API reference](https://libtmux.org/en/rs/latest/reference/): every public symbol, generated from the source. Hosted on libtmux.org. ## Optional - [Full text of every page above](https://libtmux.org/en/rs/latest/llms-full.txt): the same prose concatenated, for a single fetch.