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-java latest

ControlClient.attach

Attaches, then leaves unless the live server is still the process that was captured.

Source and package
Qualified name
io.github.libtmux.control.ControlClient.attach
Package
io.github.libtmux.control
Declared in
ControlClient
Distribution
io.github.libtmux:libtmux
Source
libtmux/src/main/java/io/github/libtmux/control/ControlClient.java
Other languages
Perl Erlang PowerShell Julia Elixir Haskell Common Lisp Python Ruby Lua TypeScript RustGoC#C++ Swift Kotlin Scala OCaml F# Clojure

Description#

A pid can be reused, so the version tmux reports is part of the check. A mismatch detaches before this client changes the server: layout refresh runs only after the check passes.

Parameters
  • config (ServerConfig) #

  • session (SessionId) #

  • serverPid (long) # – the tmux process a capture recorded for attach(config, session, serverPid, serverVersion, timeout)

  • serverVersion (String) # – the version text that process reported, compared as text for attach(config, session, serverPid, serverVersion, timeout)

  • timeout (Duration) #

  • carrier (ControlCarrier) # for attach(carrier, config, session, serverPid, serverStartTime, serverVersion, timeout)

  • serverPid (long) # for attach(carrier, config, session, serverPid, serverStartTime, serverVersion, timeout)

  • serverStartTime (java.util.OptionalLong) # – when the captured process started, as #{start_time} reported it; compared when present, since a restarted tmux can be given the same pid and version for attach(carrier, config, session, serverPid, serverStartTime, serverVersion, timeout)

  • serverVersion (String) # for attach(carrier, config, session, serverPid, serverStartTime, serverVersion, timeout)

tmux command#

The tmux commands behind attach.

tmux C API#

The C declarations in tmux that implement these commands.

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
Rust control.ControlMode.attach
Go tmux.Server.AttachSession
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