# tmux.Plan.NewSession

- **Module:** tmux.Plan
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-go/blob/5f808882015a975a65acc7f9da5b3ff0d5cbdc91/tmux/plan_session.go#L13
- **Page:** https://libtmux.org/reference/go/tmux-plan-newsession/

```
tmux.Plan.NewSession(request: NewSessionRequest) -> Ref
```

NewSession records a detached session and returns a [Ref] to it.

KillExisting is rejected: [Server.NewSession] probes for the named session
and removes it before creating, and a plan records without reading. Record
[Plan.KillSession] before this instead, which says the same thing in the
order it happens.
