Window.link_to
Link this window into another session, so both hold the same window.
Source and package
-
Description#
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 whenNone.Errors
Returns
Error::ServerMismatchwhensession()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()));
tmux command#
The tmux commands behind link_to.
tmux C API#
The C declarations in tmux that implement these commands.
In other ports#
Link a window into another session
| Language | Equivalent |
|---|---|
| Python | libtmux |
| Ruby | Lib |
| Lua | libtmux |
| Erlang | tmux |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | window |
| Go | tmux |
| Java | io |
| C# | Lib |
| C++ | libtmux:: |
| Swift | Server |
| OCaml | Libtmux |
| Perl | Lib Explicit Server operation. Captured entities remain local observations; use a new snapshot to observe changes. |
No equivalent is recorded in PowerShell, Julia, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.