Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

command.CommandResult

Rust
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

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?;

13 declared, 0 inherited

Members

  • command method Return the sanitized logical command summary.
  • exit_code method Return the process exit code, or None when it ended by signal.
  • into_streams method Consume the result and return its exact stdout and stderr buffers.
  • request_id method Return the Core-scoped dispatch-request identity.
  • signal method Return the terminating signal, or None for an ordinary exit.
  • stderr method Return stderr exactly as captured.
  • stderr_lossy method Return a named lossy UTF-8 view of stderr.
  • stderr_utf8 method Borrow stderr as UTF-8 without copying or replacement.
  • stdout method Return stdout exactly as captured.
  • stdout_lossy method Return a named lossy UTF-8 view of stdout.
  • stdout_utf8 method Borrow stdout as UTF-8 without copying or replacement.
  • success method Return whether the process exited successfully.
  • refusal_for method Classify a nonzero status as a refusal for a named operation.
Esc

Type to search.