# Server.session(named:)

- **Module:** Server
- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-swift/blob/254f8b2be7eb60cacc3ffcb3ea8e456784f582df/Sources/LibTmux/Lookup.swift#L51
- **Page:** https://libtmux.org/en/swift/latest/reference/server-session(named-)/

```
Server.session(named:)(named: String) -> Session?
```

The session with this name, or `nil` if no session has it.

Names are unique among sessions, which is why this returns one rather
than a list. Use ``hasSession(_:)`` when only existence matters — it asks
tmux a question it answers with an exit status and decodes nothing.

## Raises

- `TmuxError`
