Server.run_shell
Execute a shell command via $ tmux run-shell.
Source and package
-
Examples#
>>> result = server.run_shell('true')>>> isinstance(result, list)True- Parameters
-
-
background(bool | None) # – Run in background (-bflag). -
as_tmux_command(bool | None) # – Parse argument as a tmux command instead of a shell command (-Cflag). -
target_pane(str | None) # – Target pane for output (-tflag). -
cwd(StrPath | None) # – Start directory for the shell command (-cflag). When omitted, tmux uses the target client's current working directory. Requires tmux 3.4+; on older tmux a warning is emitted and the kwarg is ignored. Note: tmux's-cis a start directory, not subprocess semantics. Ifchdir(cwd)fails, tmux falls back to the user's home directory, then to/, rather than raising — unlike Python'ssubprocess.Popen(cwd=)which errors on a failed chdir. added 0.57 -
show_stderr(bool | None) # – Combine the command's stderr into the captured output stream (-Eflag, maps toJOB_SHOWSTDERR). Requires tmux 3.6+; on older tmux a warning is emitted and the kwarg is ignored. added 0.57 -
args(list[str] | None) # – Positional arguments passed after command, expanded as#{1},#{2}, … inside it. Requires tmux 3.7+; warns and is ignored on older tmux.
- Returns
-
list[str] | None Stdout lines, or None when background is True. Empty list on tmux 3.3a/3.4 (upstream stdout passthrough was broken until 3.5).
tmux command
run-shellIn other ports Run a shell command through tmux
- PowerShell No source-verified PowerShell equivalent is recorded for this operation.
- Julia No source-verified Julia equivalent is recorded for this operation.
- Ruby
- Lua No source-verified Lua equivalent is recorded for this operation.
- TypeScript
- Rust
- Go
- Java
- C#
- C++
- Swift
Server.run(_:in:)types a command into a pane rather than running it on the host - Kotlin No source-verified Kotlin equivalent is recorded for this operation.
- Scala No source-verified Scala equivalent is recorded for this operation.
- F# No source-verified F# equivalent is recorded for this operation.