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

session.WindowPlacement

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

View as Markdown

Module
session
Package
libtmux
Source
crates/libtmux/src/session.rs
enum session.WindowPlacement
enum [source]
enum [source]
enum session.WindowPlacement

Where a new window goes, relative to the index it is given.

Without one, tmux takes the first free index.

Examples

use libtmux::{NewWindowOptions, WindowPlacement};
let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("work").await?;
let first = session.active_window().await?.expect("a session has a window");
// Inserting before an index shifts the windows already at or after it, so
// the index a caller holds is only good until the next insert.
let inserted = session
.new_window(
NewWindowOptions::new("inserted")
.index(first.index())
.placement(WindowPlacement::Before),
)
.await?;
assert!(inserted.index() <= first.index());
guard.shutdown().await?;

2 declared, 0 inherited

Members

  • After constant Insert after it.
  • Before constant Insert before the target index, shifting later windows along.
Esc

Type to search.