Server.cmd
Execute tmux command respective of socket name and file, return output.
Source and package
-
Examples#
>>> server.cmd('display-message', 'hi')<libtmux.common.tmux_cmd object at ...>New session:
>>> server.cmd('new-session', '-d', '-P', '-F#{session_id}').stdout[0]'$2'>>> session.cmd('new-window', '-P').stdout[0]'libtmux...:2.0'Output of
tmux -L ... new-window -P -F#{window_id}to aWindowobject:>>> Window.from_window_id(window_id=session.cmd(... 'new-window', '-P', '-F#{window_id}').stdout[0], server=session.server)Window(@4 3:..., Session($1 libtmux_...))Create a pane from a window:
>>> window.cmd('split-window', '-P', '-F#{pane_id}').stdout[0]'%5'Output of
tmux -L ... split-window -P -F#{pane_id}to aPaneobject:>>> Pane.from_pane_id(pane_id=window.cmd(... 'split-window', '-P', '-F#{pane_id}').stdout[0], server=window.server)Pane(%... Window(@... ...:..., Session($1 libtmux_...)))
In other ports#
Run a tmux command this port does not model
| Language | Equivalent |
|---|---|
| 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 |
| Rust | 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#.