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

View as Markdown

Module
window
Declared in
Window
Package
libtmux
Source
crates/libtmux/src/window.rs
Other languages
PythonTypeScriptGoJava.NETC++Swift

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.

In other ports Link a window into another session

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()));
>>> w = session.new_window(window_name='link_test')
>>> s2 = server.new_session(session_name='link_target')
>>> w.link(s2)
await window.link({ session: "other" });

0 declared, 0 inherited

Esc

Type to search.