Server.cmd
Execute one raw logical tmux command.
Source and package
-
Description#
A non-zero process exit status is returned in
CommandResult. The connected daemon must meetTmuxVersion::MIN_SUPPORTED; a cold endpoint checks the executable that would start it. A queue guard refuses a replacement with a different version before effects. Standalone-Vand-hretain native executable diagnostics below the floor; an open control connection cannot represent those client flags.Errors
Returns an error when the process cannot be started, captured, awaited, or is cancelled by timeout or shutdown. Invalid or unsupported daemon versions and failed version probes are errors before dispatch.
Examples#
let server = libtmux::Server::builder().socket_path("/tmp/libtmux-rs-test/command-example-absent.sock").build()?;let result = server.cmd(libtmux::Command::new("list-sessions")).await?;assert!(result.exit_code().is_some());server.shutdown().await?;
Guides#
Pages that discuss cmd.
In other ports#
Run a tmux command this port does not model
| Language | Equivalent |
|---|---|
| Python | libtmux |
| Ruby | Lib |
| Lua | libtmux |
| Erlang | tmux Executes an explicit command value with bounded output and separate outcome and cleanup evidence. |
| Elixir | Lib Runs one trusted Command without attaching a client and returns bounded output with exit evidence. |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | server |
| Go | tmux |
| Java | io |
| C# | no equivalent on Server |
| C++ | no equivalent on Server |
| Swift | no equivalent on Server |
| OCaml | No direct public OCaml equivalent is recorded for this operation. |
| Perl | Lib Checked literal argument vector; no shell wrapper or implicit tmux command list. |
No equivalent is recorded in PowerShell, Julia, Common Lisp, Clojure, Kotlin, Scala or F#.