Server.AttachSession
AttachSession attaches the caller's terminal to a matching session and blocks until detach or context cancellation. Nil standard streams inherit the process streams; each stream must be a concrete terminal descriptor. The call retains caller-supplied files while attached and never owns or closes them. A completed nonzero exit returns CommandError; cancellation can end waiting but does not prove that attachment or detachment did not occur. On Unix, cancellation requests a tmux disconnect before bounded forced cleanup. If the daemon cannot respond, callers may need to restore their terminal state after the call returns.
Source and package
- Qualified name
-
tmux.Server. Attach Session - Package
- tmux
- Declared in
Server- Distribution
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/server_attach.go
- Other languages
- Perl Erlang PowerShell Julia Elixir Haskell Common Lisp Python Ruby Lua TypeScript RustJavaC#C++ Swift Kotlin Scala OCaml F# Clojure
- func (s Server) AttachSession( ctx context
.Context , request AttachSession , ) errorRequest -
Description#
Alone among this package's operations, it leaves tmux's own locale detection alone, because what tmux writes here reaches the caller's terminal rather than this package. See
Session.Attachfor the session-scoped form.- Parameters
tmux command#
The tmux commands behind AttachSession.
tmux C API#
The C declarations in tmux that implement these commands.
In other ports#
Attach a client to a session
| Language | Equivalent |
|---|---|
| Python | libtmux |
| 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 |
| Java | io |
| C# | Lib |
| C++ | libtmux:: |
| 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#.