# io.github.libtmux.transport.TmuxTransport.TmuxTransport.execute

- **Module:** io.github.libtmux.transport.TmuxTransport.TmuxTransport
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-java/blob/c3517519ee799428a809ce6deb1708c8be289cd1/libtmux/src/main/java/io/github/libtmux/transport/TmuxTransport.java#L25
- **Page:** https://libtmux.org/reference/java/io-github-libtmux-transport-tmuxtransport-tmuxtransport-execute/

```
io.github.libtmux.transport.TmuxTransport.TmuxTransport.execute(request: CommandRequest) -> CommandResult
```

Runs the request to completion.

<p>An implementation writes {@link CommandRequest#input()} to tmux's standard input and
closes it. A command that reads standard input and is given none reads end of file, which
tmux reports as success over an empty result rather than as a failure.

## Parameters

- `request` (CommandRequest) — what to run, what it reads, and how long to wait

## Returns

the exit status and both channels; a nonzero exit is a result, not a failure

## Raises

- `TmuxTransportException` — if the command could not be run to completion, carrying how certain it is that tmux applied it
- `IllegalStateException` — if this transport is closed
