io.github.libtmux.Pane.Pane.run
Java
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust Unavailable
- Go Unavailable
- Java
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- io.github.libtmux.Pane
- Declared in
- Pane
- Package
- io.github.libtmux:libtmux
- Source
- libtmux/src/main/java/io/github/libtmux/Pane.java
-
Runs a shell command in this pane to its end, and answers with its exit status and output.
Reach for this first whenever the command is yours. Nothing is inferred from the screen: the command runs in a subshell of the pane's own shell, whose trap reports
$?and signals a privatewait-forchannel, so the wait is tmux's and the status is the shell's. The trap covers interrupt and terminate as well as exit, so a command someone stops at the pane ends this call with the status it was stopped with rather than leaving it waiting. The output is what the command printed and nothing else — not the typed line, not the prompt — cut out between two markers the plumbing prints around it.It runs in the shell a person set up — its directory, its environment, a virtualenv someone activated — which is the reason to type it there rather than start a process of your own. The pane has to be running a POSIX shell for the typed line to mean what it says.
A command still running at the deadline keeps running; the answer carries what it had printed by then, and
PaneRun#exact()is false.Examples
PaneRun built = pane.run("make test", Duration.ofMinutes(5));if (!built.succeeded()) {System.err.println(String.join("\n", built.output()));}- Parameters
- Raises
-
-
IllegalStateException – if the pane is not running a POSIX shell
-
InterruptedException – if the waiting thread is interrupted
-
0 declared, 0 inherited