libtmux Reference MCP Search
On this page

libtmux::Server::run_shell

View as Markdown

Module
libtmux
Declared in
Server
Package
libtmux-cxx
Source
include/libtmux/server.hpp
run_shell ( command : std::string_view , background : bool = false ) expected< void, CommandFailure >
methodreadonly [source]
methodreadonly [source]
run_shell

Run a shell command on the machine the server is on.

Reports whether it ran, not what it printed. tmux hands back the output on most versions and discards it on 3.3a and 3.4, and an answer that is empty on two versions in the middle of the range is worse than no answer at all. A caller that needs the output redirects it to a file.

What is uniform is the exit status: a command that fails is a failure here, carrying its code in exit_code .

background is tmux's -b, which returns as soon as the command is started. Nothing can then be said about how it ended, so a backgrounded command that fails still reports success.

0 declared, 0 inherited

Esc

Type to search.