# pane.Pane

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

One tmux pane, as reached through one window link.

A pane belongs to exactly one window, but that window can be linked into
several sessions. The handle retains the link it was discovered through so
traversal back up the hierarchy lands where the caller came from.

## Example

```rust
let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("work").await?;
let window = session.active_window().await?.expect("a session has a window");
let pane = window.active_pane().await?.expect("a window has a pane");

pane.send_line("echo hello").await?;

// Capture returns `TmuxText`, because a pane can print any bytes.
let lines = pane.capture().await?;
assert!(!lines.is_empty());

guard.shutdown().await?;
```

## Members

- `from_env` (method): Find the pane this process is running in.
- `from_env_value` (method): Find a pane from an explicit `TMUX_PANE` value.
- `id` (method): Return the tmux pane identity.
- `window_id` (method): Return the window that contains this pane.
- `window_index` (method): Return the window index for the session through which this pane was reached.
- `session_id` (method): Return the session this handle reached the pane through.
- `index` (method): Return the pane's index within its window.
- `current_command` (method): Return the command currently running in the pane.
- `current_path` (method): Return the pane's working directory.
- `title` (method): Return the pane title.
- `tty` (method): Return the pane's controlling terminal.
- `pid` (method): Return the process id of the pane's foreground process.
- `width` (method): Return the pane width in cells.
- `height` (method): Return the pane height in cells.
- `left` (method): Return the pane's left edge, in cells from its window's own left edge.
- `top` (method): Return the pane's top edge, in cells from its window's own top edge.
- `is_active` (method): Report whether this pane is the active one in its window.
- `is_at_top` (method): Report whether the pane touches the top edge of its window.
- `is_at_bottom` (method): Report whether the pane touches the bottom edge of its window.
- `is_at_left` (method): Report whether the pane touches the left edge of its window.
- `is_at_right` (method): Report whether the pane touches the right edge of its window.
- `is_dead` (method): Report whether the pane's process has exited while the pane remains.
- `is_input_disabled` (method): Report whether tmux has disabled input for this pane.
- `is_synchronized` (method): Report whether this pane has synchronized input enabled.
- `is_piped` (method): Report whether tmux is copying this pane's output to a command.
- `is_in_mode` (method): Report whether the pane is in copy mode or another pane mode.
- `refresh` (method): Replace this handle's snapshot with the pane's current state.
- `refreshed` (method): Return a new handle holding the pane's current state.
- `window` (method): Return the window that contains this pane.
- `session` (method): Return the session this pane was reached through.
- `split` (method): Split this pane, putting a new one beside it.
- `resize_by` (method): Move one edge of the pane by a number of cells.
- `toggle_zoom` (method): Zoom the pane to fill its window, or restore it if it already fills it.
- `send_keys` (method): Send keys to the pane as if typed.
- `send_line` (method): Send literal text followed by Enter as one dispatch.
- `send_key_names` (method): Send tmux key names, such as `C-c` or `Enter`.
- `select` (method): Make this pane active in its window.
- `resize` (method): Resize the pane to an exact size in cells.
- `kill` (method): Kill the pane.
- `cmd` (method): Run a raw tmux command against this pane.
- `format` (method): Expand a tmux format string in this pane's context.
- `display` (method): Show a message on the clients viewing this pane's window.
- `set_title` (method): Set the pane's title.
- `clear_history` (method): Clear the pane's scrollback history.
- `paste_buffer` (method): Paste a buffer's contents into the pane.
- `pipe` (method): Pipe the pane's output to a shell command.
- `respawn` (method): Restart the pane's command in place.
- `swap_with` (method): Swap this pane's position with another.
- `break_out` (method): Move this pane out into a window of its own.
- `join_into` (method): Move this pane into another window, beside a pane already there.
- `copy_mode` (method): Enter copy mode.
- `exit_mode` (method): Leave copy mode, or any other mode the pane is in.
- `clock_mode` (method): Show the clock in this pane.
- `send_prefix` (method): Send the configured prefix key to the pane.
- `get` (method): Read one field of this pane's snapshot, named by the handle that filters it.
- `stream_output` (method): Watch what this pane writes, as it writes it.
- `stream_output_with_limits` (method): Like [`Self::stream_output`], with explicit frame budgets.
- `capture` (method): Capture the pane's visible contents, one entry per line.
- `capture_with` (method): Read the pane's contents, choosing how much and in what form.
- `capture_lines` (method): Capture with the per-line flags tmux records, marking shell prompts.
- `wait_for_text` (method): Wait until this pane's output contains `needle`.
- `wait_for_quiet` (method): Wait until this pane stops producing output for `quiet_for`.
- `wait_until` (method): Wait until `settled` holds for this pane's captured lines.
- `option_names` (method): List the option names set at this pane's scope.
- `options` (method): Read every option set on this pane, decoded by its declared kind.
- `set_option` (method): Set one option to text, unchecked.
- `set_typed_option` (method): Set one option to a typed value, checked before it is sent.
- `append_option` (method): Append to one option rather than replacing it.
- `unset_option` (method): Remove one option, restoring whatever it inherits.
- `set_hook` (method): Set one hook to a tmux command.
- `unset_hook` (method): Remove one hook.
- `hook` (method): Read one hook's commands, or `None` when it holds nothing.
- `typed_option` (method): Read one option, decoded according to what tmux declares about it.
