# LibTmux::Pane#pipe

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

```
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`)

## tmux command

The tmux commands behind `pipe`.

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

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_pipe_pane_entry`](/en/tmux/latest/reference/c-variable-cmd_pipe_pane_entry/) (attribute)
- [`cmd_pipe_pane_exec`](/en/tmux/latest/reference/c-function-cmd-pipe-pane-c-cmd_pipe_pane_exec/) (function)

## In other ports

Copy a pane's output to a shell command

| Language | Equivalent |
| --- | --- |
| 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.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) |

No equivalent is recorded in Lua, PowerShell, Julia, Elixir, Kotlin, Scala or F#.
