# LibTmux::Server.attach-async

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

```
method attach-async(SessionId:D :$session!, IO::Handle:D :$terminal!,
                    Bool:D :$read-only = False, Bool:D :$detach-others = False,
                    Bool:D :$update-environment = False,
                    Cancellation :$cancel = Cancellation --> Promise:D)
```

Resolve a separately owned terminal client; process creation is not attachment proof.

Resolve a separately owned terminal client; process creation is not attachment proof.

## Parameters

- `$session` (`SessionId:D`)
- `$terminal` (`IO::Handle:D`)
- `$read-only?` (`Bool:D`)
- `$detach-others?` (`Bool:D`)
- `$update-environment?` (`Bool:D`)
- `$cancel?` (`Cancellation`)

## tmux command

The tmux commands behind `attach-async`.

- [`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)
