# pane.Pane.pipe

- **Module:** pane.Pane
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/pane.rs#L964
- **Page:** https://libtmux.org/en/rs/latest/reference/pane-pane-pipe/

```
pane.Pane.pipe(self, command: Option<impl Into<OsString>>) -> Result<(), Error>
```

Pipe the pane's output to a shell command.

Passing `None` stops any pipe already running for this pane.

tmux expands the command as a format, through `strftime` first: it
calls `format_expand_time` for `pipe-pane` as it does for
`display-message`. So `#{pane_id}` resolves, and a `%` is a time
conversion -- `>> log-%Y` writes to a file named for the year. Write
`%%` for a literal `%`, and see [`crate::Server::format`] for what an
undefined conversion does differently on macOS.

# Errors

Returns an error when tmux refuses the command.
