# LibTmux.Server.RunShellAsync

- **Module:** LibTmux.Server
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/320dc64f4b8b7815842471327a5e6b84a1499bf8/src/LibTmux/Server.Execution.cs#L71
- **Page:** https://libtmux.org/en/dotnet/latest/reference/libtmux-server-runshellasync/

```
LibTmux.Server.RunShellAsync(request: RunShellRequest, cancellationToken: CancellationToken) -> Task<IReadOnlyList<string>?>
```

Runs a shell command and reports what it printed.

The directory flag arrived in tmux 3.4, the error-output flag in 3.6,
and passing arguments without a shell in 3.7.

## Parameters

- `request` (RunShellRequest): What to run, and how.
- `cancellationToken` (CancellationToken): Cancels waiting for tmux's reply. tmux itself is not told: the server,
not this process, owns <c>run-shell</c>'s spawned command, so cancelling
stops this call from waiting on it, not the command from running. Nor
does stopping the whole server: <see cref="KillAsync" /> does not reap
a <c>run-shell</c> child either, so it keeps running as its own
orphaned process.

## Returns

What the command printed, or null when tmux did not wait for it.
