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

ControlMode.attach

Attach to a session in control mode.

Source and package
Qualified name
libtmux::control::ControlMode::attach
Module
control
Declared in
ControlMode
Package
libtmux
Source
crates/libtmux/src/control.rs
Other languages
Perl Erlang PowerShell Julia Elixir Haskell Common Lisp Python Ruby Lua TypeScript GoJavaC#C++ Swift Kotlin Scala OCaml F# Clojure
pub async fn attach( server: &Server, session: &SessionId ) -> Result<Self, Error>

Description#

When this returns, tmux has the client attached: anything that changes the server afterwards is reported. Returning as soon as the process started would look the same and lose every notification racing the attach, which is the hardest kind of bug to see.

Errors

Refuses a daemon ranking below 3.7 final (next-3.7, 3.7 release candidates). Capacity, metadata, socket pinning and the opening handshake share one deadline from attach entry. Process, pipe and framing failures also refuse the attachment.

Cancel safety

Nothing is left held: a dropped attach kills and reaps the tmux client it started.

Parameters

Guides#

Pages that discuss attach.

In other ports#

Attach a client to a session

Equivalents of Attach a client to a session in other languages
Language Equivalent
Python libtmux.Session.attach
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript no direct equivalent; the client is out of scope for this port
Go tmux.Server.AttachSession
Java io.github.libtmux.control.ControlClient.attach
C# LibTmux.Server.AttachSessionAsync
C++ libtmux::Session::attach_command
Swift reached through Server.connected(attachingTo:), which scopes a block rather than attaching a client
OCaml No direct public OCaml equivalent is recorded for this operation.
Perl attach_argv builds caller-owned terminal arguments without performing attachment; the caller owns process and TTY lifetime.

No equivalent is recorded in Ruby, Lua, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.

Esc

Type to search.

Reference previewOpen reference