Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

window.SplitOptions

Rust
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

View as Markdown

Module
window
Package
libtmux
Source
crates/libtmux/src/window.rs
struct window.SplitOptions
structoverload [source]
structoverload [source]
struct window.SplitOptions

Options for splitting a window or pane into a new pane.

A bare SplitDirection is accepted wherever this is: window.split(SplitDirection::Below).

Examples

use libtmux::{SplitDirection, SplitOptions};
let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("split").await?;
let window = session.active_window().await?.expect("a session has a window");
// Splitting leaves focus where it was unless asked otherwise, so a caller
// that wants the new pane selected says so.
let pane = window
.split(SplitOptions::new(SplitDirection::Right).select())
.await?;
assert_eq!(window.active_pane().await?.map(|active| active.id().to_string()),
Some(pane.id().to_string()));
guard.shutdown().await?;

8 declared, 0 inherited

Members

  • command method Run a command instead of the default shell.
  • environment method Set an environment variable for the process the new pane starts.
  • full method Span the full width or height of the window rather than of the pane.
  • new method Describe a split placing the new pane in one direction.
  • select method Make the new pane active.
  • size method Give the new pane a size, in cells or as a share of the space.
  • start_directory method Set the new pane's working directory.
  • zoom method Zoom the new pane, filling the window until it is unzoomed.
Esc

Type to search.