# Server.buffer(named:)

- **Module:** Server
- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-swift/blob/f02a4668570e1cc5198c941413750e021f42c214/Sources/LibTmux/Buffers.swift#L47
- **Page:** https://libtmux.org/reference/swift/server-buffer(named-)/

```
Server.buffer(named:)(named: String?) -> String?
```

Reads a buffer's contents, or `nil` if no such buffer exists.

Runs in a process of its own even on a connected server, so that the
answer does not depend on which mode asked. A connection reports a
command's output as *lines*, and `show-buffer` writes the buffer as
bytes with a terminator after them — so a buffer ending in a newline and
one that does not arrive in the same shape as a listing whose last row
is empty. Nothing on the wire tells the two apart, and every supported
tmux behaves this way, so the bytes are read from a process instead of
guessed at.

## Raises

- `TmuxError`
