On this page
command.CommandResult
- Module
- command
- Package
- libtmux
- Source
- crates/libtmux/src/command.rs
-
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
- command method
- exit_code method
- into_streams method
- new method
- refusal_for method
- request_id method
- signal method
- stderr method
- stderr_lossy method
- stderr_utf8 method Borrow stderr as UTF-8 without copying or replacement.
- stdout method
- stdout_lossy method
- stdout_utf8 method Borrow stdout as UTF-8 without copying or replacement.
- success method