# LibTmux::Server.attach

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Raku
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-raku/blob/e76160bcce6e03976d49424da15b7c31afb2c68e/lib/LibTmux/Server.rakumod#L591
- **Page:** https://libtmux.org/en/raku/latest/reference/libtmux-server-attach/

```
method attach(SessionId:D :$session!, IO::Handle:D :$terminal!, *%settings --> LibTmux::Attachment:D)
```

Spawn a separately owned interactive client on the caller's explicit terminal.

Spawn a separately owned interactive client on the caller's explicit terminal.

## Parameters

- `$session` (`SessionId:D`)
- `$terminal` (`IO::Handle:D`)
- `%settings`

## tmux command

The tmux commands behind `attach`.

- [`attach-session`](/en/tmux/latest/manual/attach-session/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_attach_session_entry`](/en/tmux/latest/reference/c-variable-cmd_attach_session_entry/) (attribute)
- [`cmd_attach_session_exec`](/en/tmux/latest/reference/c-function-cmd-attach-session-c-cmd_attach_session_exec/) (function)

## In other ports

Attach a client to a session

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Session.attach`](/en/py/latest/reference/libtmux-session-attach/) (method) |
| 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`](/en/rs/latest/reference/control-controlmode-attach/) (method) |
| Go | [`tmux.Server.AttachSession`](/en/go/latest/reference/tmux-server-attachsession/) (method) |
| Java | [`io.github.libtmux.control.ControlClient.attach`](/en/java/latest/reference/io-github-libtmux-control-controlclient-controlclient-attach/) (method) |
| C# | [`LibTmux.Server.AttachSessionAsync`](/en/csharp/latest/reference/libtmux-server-attachsessionasync/) (method) |
| C++ | [`libtmux::Session::attach_command`](/en/cxx/latest/reference/libtmux-session-attach_command/) (method) |
| 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#.
