# LibTmux::Pane#pipe

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Ruby
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ruby/blob/d8ce4bbee0ca7748a81929f81f7d8d07f8c51267/gems/libtmux/lib/libtmux/operations.rb#L391
- **Page:** https://libtmux.org/en/ruby/v0.1.0.alpha.3/reference/libtmux-pane-pipe/

tmux command: [`pipe-pane`](/en/tmux/latest/manual/pipe-pane/)

```
def pipe: (
  ?shell_command: ::String?,
  ?input: bool,
  ?output: bool,
  ?only_if_closed: bool,
  ?timeout: ::Numeric,
  ?cancel: untyped
) -> ::LibTmux::CommandResult
```

The shell command and its format expansion are explicitly requested here.
only_if_closed follows tmux -o: an existing pipe is closed, not retained.

Behavior contract: Pane pipes.

## Parameters

- `shell_command` (`::String?`)
- `input` (`bool`)
- `output` (`bool`)
- `only_if_closed` (`bool`)
- `timeout` (`::Numeric`)
- `cancel` (`untyped`)

## In other ports

### Copy a pane's output to a shell command

- Python: [`libtmux.Pane.pipe`](/en/py/latest/reference/libtmux-pane-pipe/) (method)
- TypeScript: [`pane.Pane.pipeTo`](/en/ts/latest/reference/pane-pane-pipeto/) (method)
- Rust: [`pane.Pane.pipe`](/en/rs/latest/reference/pane-pane-pipe/) (method)
- Go: [`tmux.Pane.Pipe`](/en/go/latest/reference/tmux-pane-pipe/) (method)
- Java: [`io.github.libtmux.Pane.Pane.pipeTo`](/en/java/latest/reference/io-github-libtmux-pane-pane-pipeto/) (method)
- C#: [`LibTmux.Pane.PipeAsync`](/en/csharp/latest/reference/libtmux-pane-pipeasync/) (method)
- C++: [`libtmux::Pane::pipe_to`](/en/cxx/latest/reference/libtmux-pane-pipe_to/) (method)
- Swift: [`Server.pipe(_:to:)`](/en/swift/latest/reference/server-pipe(_-to-)/) (method)
