# tmux.Server.SessionByName

- **Module:** tmux.Server
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-go/blob/52968a3181c1c9e6d1b26c565d4b170968ae61c0/tmux/lookup.go#L32
- **Page:** https://libtmux.org/en/go/latest/reference/tmux-server-sessionbyname/

```
tmux.Server.SessionByName(ctx: context.Context, name: string) -> (Session, error)
```

SessionByName performs a live lookup of the session tmux knows by name and returns a newly materialized record. A name no session holds reports [ErrNotFound].

tmux keeps session names unique, so a name identifies one session for as
long as it keeps it. A [SessionID] does not change, which is why the records
this package hands back carry one and [Server.Session] takes one; a name is
what a person types and what a workspace file records.
