# tmux.Session.MarshalJSON

- **Module:** tmux.Session
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-go/blob/52968a3181c1c9e6d1b26c565d4b170968ae61c0/tmux/marshal.go#L29
- **Page:** https://libtmux.org/en/go/latest/reference/tmux-session-marshaljson/

```
tmux.Session.MarshalJSON() -> ([]byte, error)
```

MarshalJSON encodes the session's identity and the format expansions tmux returned for it, under "formats". Nothing decodes: a decoded record would carry no [Server], so it could name a session it could never act on, and [json.Unmarshal] into this type reports no error and changes nothing.
