# tmux.Server.SaveBuffer

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

```
tmux.Server.SaveBuffer(ctx: context.Context, request: SaveBufferRequest) -> error
```

SaveBuffer writes a named or most-recent buffer to a file. Path follows [Server.SourceFile]'s current-user expansion and lexical normalization. It changes that file. Exact "-" is rejected because it names tmux's stdout rather than a path; [Server.SaveBufferTo] streams to an [io.Writer], and this method is the one that runs over a [Connection].
