# LibTmux::Server#attach

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Ruby
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ruby/blob/dcc9f8b5a6970144a9e7d80cd5f381d8f6198372/gems/libtmux/lib/libtmux/terminal.rb#L47
- **Page:** https://libtmux.org/en/ruby/v0.1.0.alpha.2/reference/libtmux-server-attach/

```
def attach: (
  session: ::LibTmux::EntityRef,
  terminal: ::IO,
  term: ::String,
  ?read_only: bool,
  ?timeout: ::Numeric?,
  ?cancel: untyped
) -> ::LibTmux::TerminalResult
```

Blocks until the owned interactive client exits. The caller supplies and
retains its TTY. Cancellation detaches this client, not pane commands.

Behavior contract: Terminal attachment.

## Raises

- `ArgumentError`
