# libtmux::Session::attach_command

- **Module:** libtmux::Session
- **Package:** libtmux-cxx
- **Language:** C++
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-cxx/blob/85e8bd603a322dc32bb8b9aeb1a72bcf36945f1d/include/libtmux/entities.hpp#L362
- **Page:** https://libtmux.org/reference/cxx/libtmux-session-attach_command/

```
libtmux::Session::attach_command() -> expected< AttachCommand, CommandFailure >
```

A command line that attaches a terminal to this session.

Not a method that attaches: a tmux client needs a terminal, and every command this library runs talks to it through pipes, so an attach it performed itself could only ever fail. Spawn the returned argv and retain the value until that client exits.
