# spawnCapturing(_:_:)

- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-swift/blob/e72fb5c17ab54996233b76b037c3b94a46e55685/Tests/TmuxFixture/TmuxLane.swift#L15
- **Page:** https://libtmux.org/en/swift/latest/reference/spawncapturing(_-_-)/

```
spawnCapturing(executable: String, arguments: [String]) -> (
    output: String, error: String, status: Int32
)?
```

Runs `executable` and captures what it prints, without this library.

`posix_spawn` rather than `Process` or `popen`: this runs while the runner
plans tests on several threads, and a fork from a multithreaded process can
deadlock in the child before it execs, leaving its pipes open forever.

## Parameters

- `executable` (`String`)
- `arguments` (`[String]`)
