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-ts latest

Server.cmd

Run a tmux command this package does not model.

Source and package
Qualified name
Server.cmd
Module
server
Declared in
Server
Package
libtmux
Source
packages/libtmux/src/server.ts
Other languages
PowerShell Julia Elixirfunction PythonRubyLuaRustGoJava C# C++ Swift Kotlin Scala F#
cmd( command: string, args: readonly string[] = [], options?: CmdOptions, ): Promise<readonly string[]>

Description#

tmux has many more commands than any wrapper types. Rather than leaving a caller to build their own subprocess — and reproduce the socket, the environment, the deadline, and the error handling — this runs one through the same path every other operation uses.

Failure raises TmuxCommandError like any other command, carrying tmux's own stderr.

Examples#

await server.cmd("list-keys", ["-T", "copy-mode"]);
Parameters

Guides#

Pages that discuss cmd.

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
Elixir LibTmux.Server.run/3 Runs one trusted Command without attaching a client and returns bounded output with exit evidence.
Rust server.Server.cmd
Go tmux.Server.Cmd
Java io.github.libtmux.Server.cmd
C# no equivalent on Server
C++ no equivalent on Server
Swift no equivalent on Server

No equivalent is recorded in PowerShell, Julia, Kotlin, Scala or F#.

Esc

Type to search.

Reference previewOpen reference