libtmux Reference MCP Search
On this page

window.Window.link_to

View as Markdown

Module
window
Declared in
Window
Package
libtmux
Source
crates/libtmux/src/window.rs

Link this window into another session, so both hold the same window.

A linked window is one window with two winlinks, not a copy: renaming it or splitting it shows up in both sessions. Window::unlink takes one link away again.

index places the link at a window index, or appends when None.

Errors

Returns Error::ServerMismatch when session belongs to another server, or an error when tmux refuses the link, including an occupied index.

Examples

let source = server.new_session("linking-from").await?;
let target = server.new_session("linking-to").await?;
let window = source.windows().await?.remove(0);

window.link_to(&target, None).await?;

let linked = target.windows().await?;
assert!(linked.iter().any(|other| other.id() == window.id()));

0 declared, 0 inherited

Esc

Type to search.