# 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/52968a3181c1c9e6d1b26c565d4b170968ae61c0/tmux/plan_session.go#L13
- **Page:** https://libtmux.org/en/go/latest/reference/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.
