JoinOptions
Where a pane lands when it is moved into another window.
Source and package
- Qualified name
-
libtmux::window:: Join Options - Module
- window
- Package
- libtmux
- Source
- crates/libtmux/src/window.rs
-
Description#
Pane::break_out()takes a pane out into a window of its own and this puts one back, so between them a pane can be moved anywhere. tmux spawns nothing here, which is why this carries none of the command, directory, or environment aSplitOptionsdoes: the pane already exists and keeps everything running in it.Examples#
use libtmux::{JoinOptions, SplitDirection};let guard = libtmux::test::TestServer::new().await?;let session = guard.server().new_session("moving").await?;let window = session.active_window().await?.expect("a window");let second = session.new_window("elsewhere").await?;let stranded = second.panes().await?.remove(0);// Put a pane from the other window beside this one.let here = window.panes().await?.remove(0);let moved = stranded.join_into(&here, JoinOptions::new(SplitDirection::Below)).await?;assert_eq!(moved.window_id(), window.id());guard.shutdown().await?;