# capture/with
Capture all `echo`/`println` output produced by invoking a 0-arity callable. Safe to nest — restores any prior capture buffer on exit.
## Syntax
[capture/with $thunk]
## Parameters
- `$thunk` — zero-arity closure whose captured output is collected.
## Examples
[capture/with { echo "hi" }] # → %{ :result nil :output @("hi") }
## Returns
Map `%{ :result $r :output $lines }`, where `:result` is the thunk's return value and `:output` is the list of captured lines.
## See Also
`capture/start`, `capture/flush`, `capture/clear`