WindowPlacement
Where a new window goes, relative to the index it is given.
Source and package
- Qualified name
-
libtmux::session:: Window Placement - Module
- session
- Package
- libtmux
- Source
- crates/libtmux/src/session.rs
-
Description#
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?;