# libtmux::Server::set_buffer

- **Module:** libtmux::Server
- **Package:** libtmux-cxx
- **Language:** C++
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-cxx/blob/393d4b0ad666f18a6581f1eb281741a75a7503f0/include/libtmux/server.hpp#L402
- **Page:** https://libtmux.org/en/cxx/latest/reference/libtmux-server-set_buffer/

```
libtmux::Server::set_buffer(name: std::string_view, data: std::string_view) -> expected< void, CommandFailure >
```

Put text in a named buffer, replacing what was there.

An empty name lets tmux choose one, which is what a caller copying without caring about the name wants.
