Server.runShell
Run a shell command through tmux and return whatever it printed.
Source and package
-
Description#
signalandtimeoutMsbound this call's own wait; the tmux server owns and runsrun-shellitself, decoupled from this client, so neither one stops the command - only this call's own promise settling early.Requires tmux 3.5 or newer. tmux 3.3a and 3.4 print a clientless
run-shell's output to a view-mode pane, so they raiseVersionTooLowError;cmd("run-shell", …)runs the command there without its output.Examples#
const lines = await server.runShell("echo hello");lines[0]; // "hello"
tmux command#
The tmux commands behind runShell.
tmux C API#
The C declarations in tmux that implement these commands.
In other ports#
Run a shell command through tmux
| Language | Equivalent |
|---|---|
| Python | libtmux |
| Ruby | Lib |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| Rust | server |
| Go | tmux |
| Java | io |
| C# | Lib |
| C++ | libtmux:: |
| Swift | Server.run(_:in:) types a command into a pane rather than running it on the host |
| OCaml | No direct public OCaml equivalent is recorded for this operation. |
| Perl | No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands. |
No equivalent is recorded in Lua, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.