Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux-rs latest

Pane.join_into

Move this pane into another window, beside a pane already there.

Source and package
Qualified name
libtmux::pane::Pane::join_into
Module
pane
Declared in
Pane
Package
libtmux
Source
crates/libtmux/src/pane.rs
pub async fn join_into( self, beside: &Self, options: crate::JoinOptions, ) -> Result<Self, Error>

Description#

The inverse of Pane::break_out(), and it consumes the handle for the same reason: the pane's window changes, so a snapshot of where it used to be is wrong. The pane keeps its id and everything running in it, so the handle returned is this same pane read again where it now lives.

Errors

Returns Error::ServerMismatch when beside belongs to another server, or an error when tmux refuses the move, including a pane joined to its own window.

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 elsewhere = session.new_window("elsewhere").await?;
let stranded = elsewhere.panes().await?.remove(0);
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?;
Parameters

tmux command#

The tmux commands behind join_into.

tmux C API#

The C declarations in tmux that implement these commands.

Esc

Type to search.

Reference previewOpen reference