libtmux Reference MCP Search
On this page

command.CommandResult

View as Markdown

Module
command
Package
libtmux
Source
crates/libtmux/src/command.rs
struct command.CommandResult
structoverload [source]
structoverload [source]
struct command.CommandResult

The exact status and output captured for one tmux command.

A non-zero exit status is returned as data. Output bytes are never trimmed, decoded, or mirrored between streams.

Examples

use libtmux::Command;

let guard = libtmux::test::TestServer::new().await?;
guard.server().new_session("work").await?;

let result = guard
    .server()
    .cmd(Command::new("list-sessions").arg("-F").arg("#{session_name}"))
    .await?;

// The exact bytes tmux emitted are kept until a caller asks for text, because
// a session name need not be UTF-8.
assert_eq!(result.stdout(), b"work\n");
assert_eq!(result.stdout_utf8()?, "work\n");

guard.shutdown().await?;

14 declared, 0 inherited

Members

Esc

Type to search.