- Module
- pane
- Package
- libtmux
- Source
- crates/libtmux/src/pane.rs
- Other languages
- PythonRubyLuaTypeScriptGoJava.NETC++Swift
-
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.
Discussed in Format-token fields
In other ports A tmux pane
- Python
libtmux.Pane - Ruby
LibTmux::Pane - Lua
libtmux.Pane - TypeScript
pane.Pane - Go
tmux.Pane - Java
io.github.libtmux.Pane.Pane - .NET
LibTmux.Pane - C++
libtmux::Pane - Swift
Pane
- Python
Examples
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?;>>> panePane(%1 Window(@1 1:..., Session($1 ...)))>>> pane in window.panesTrue>>> pane.windowWindow(@1 1:..., Session($1 ...))>>> pane.sessionSession($1 ...)The pane can be used as a context manager to ensure proper cleanup:
>>> with window.split() as pane:... pane.send_keys('echo "Hello"')... # Do work with the pane... # Pane will be killed automatically when exiting the context73 declared, 0 inherited
Members
- capture method Capture the pane's visible contents, one entry per line.
- respawn method Restart the pane's command in place.
- kill method Kill the pane.
- select method Make this pane active in its window.
- break_out method Move this pane out into a window of its own.
- send_keys method Send keys to the pane as if typed.
- split method Split this pane, putting a new one beside it.
- clear_history method Clear the pane's scrollback history.
- set_title method Set the pane's title.
- paste_buffer method Paste a buffer's contents into the pane.
- window method Return the window that contains this pane.
- resize method Resize the pane to an exact size in cells.
- options method Read every option set on this pane, decoded by its declared kind.
- id method Return the tmux pane identity.
- index method Return the pane's index within its window.
- swap_with method Swap this pane's position with another.
- pipe method Pipe the pane's output to a shell command.
- copy_mode method Enter copy mode.
- height method Return the pane height in cells.
- width method Return the pane width in cells.
- title method Return the pane title.
- is_active method Report whether this pane is the active one in its window.
- current_command method Return the command currently running in the pane.
- set_option method Set one option to text, unchecked.
- unset_option method Remove one option, restoring whatever it inherits.
- current_path method Return the pane's working directory.
- window_id method Return the window that contains this pane.
- refresh method Replace this handle's snapshot with the pane's current state.
- typed_option method Read one option, decoded according to what tmux declares about it.
- set_hook method Set one hook to a tmux command.
- unset_hook method Remove one hook.
- 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.
- display method Show a message on the clients viewing this pane's window.
- pid method Return the process id of the pane's foreground process.
- send_prefix method Send the configured prefix key to the pane.
- cmd method Run a raw tmux command against this pane.
- tty method Return the pane's controlling terminal.
- session_id method Return the session this handle reached the pane through.
- clock_mode method Show the clock in this pane.
- is_dead method Report whether the pane's process has exited while the pane remains.
- is_in_mode method Report whether the pane is in copy mode or another pane mode.
- wait_for_text method Wait until this pane's output contains
needle. - append_option method Append to one option rather than replacing it.
- from_env method Find the pane this process is running in.
- hook method Read one hook's commands, or
Nonewhen it holds nothing. - option_names method List the option names set at this pane's scope.
- send_key_names method Send tmux key names, such as
C-corEnter. - send_line method Send literal text followed by Enter as one dispatch.
- capture_lines method Capture with the per-line flags tmux records, marking shell prompts.
- capture_with method Read the pane's contents, choosing how much and in what form.
- format method Expand a tmux format string in this pane's context.
- get method Read one field of this pane's snapshot, named by the handle that filters it.
- is_piped method Report whether tmux is copying this pane's output to a command.
- join_into method Move this pane into another window, beside a pane already there.
- resize_by method Move one edge of the pane by a number of cells.
- session method Return the session this pane was reached through.
- set_typed_option method Set one option to a typed value, checked before it is sent.
- stream_output method Watch what this pane writes, as it writes it.
- toggle_zoom method Zoom the pane to fill its window, or restore it if it already fills it.
- wait_for_quiet method Wait until this pane stops producing output for
quiet_for. - wait_until method Wait until
settledholds for this pane's captured lines. - exit_mode method Leave copy mode, or any other mode the pane is in.
- from_env_value method Find a pane from an explicit
TMUX_PANEvalue. - is_input_disabled method Report whether tmux has disabled input for this pane.
- is_synchronized method Report whether this pane has synchronized input enabled.
- left method Return the pane's left edge, in cells from its window's own left edge.
- refreshed method Return a new handle holding the pane's current state.
- stream_output_with_limits method Like
Self::stream_output, with explicit frame budgets. - top method Return the pane's top edge, in cells from its window's own top edge.
- window_index method Return the window index for the session through which this pane was reached.