Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux-go latest

Server.Cmd

Cmd executes raw tmux arguments and returns caller-owned result slices. A completed nonzero exit remains a result; validation and transport failures return errors. Cancellation cannot prove whether a mutation reached tmux.

Source and package
Qualified name
tmux.Server.Cmd
Package
tmux
Declared in
Server
Distribution
github.com/libtmux/libtmux-go/tmux
Source
tmux/server.go
Other languages
Perlmethod Erlangfunction PowerShell Julia Elixirfunction Haskell Common Lisp PythonRubyLuaTypeScriptRustJava C# C++ Swift Kotlin Scala OCaml F# Clojure

Description#

An argument that is exactly ";" separates two tmux commands, so one call can submit a command list. tmux runs a list until a command fails and drops the rest, and answers with one merged stdout, so a caller that needs to know which command produced which line submits them separately. A list means the same thing through either execution binding.

Standalone -V and -h diagnose the configured executable without daemon version checks. They do not qualify a later daemon operation.

A standalone ";" separates commands across bindings. The subprocess path also follows tmux's trailing-semicolon and escaping rules; typed operations keep values literal across bindings.

On a Connection-bound server Cmd uses a lane, and tmux cannot cancel a command already sent, so a command that waits on something outside tmux, such as wait-for or a foreground run-shell, holds that lane until it finishes even after ctx ends. Server.WaitFor, Server.RunShell, and Server.IfShell take a client of their own instead.

Parameters

In other ports#

Run a tmux command this port does not model

Equivalents of Run a tmux command this port does not model in other languages
Language Equivalent
Python libtmux.Server.cmd
Ruby LibTmux::Server#run
Lua libtmux.Server:command
Erlang tmux_server:command/3 Executes an explicit command value with bounded output and separate outcome and cleanup evidence.
Elixir LibTmux.Server.run/3 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.Server.cmd
Rust server.Server.cmd
Java io.github.libtmux.Server.cmd
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 LibTmux::Server::cmd 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#.

Esc

Type to search.

Reference previewOpen reference