# LibTmux.load_buffer

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Julia
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/pane_io.jl#L174
- **Page:** https://libtmux.org/en/julia/latest/reference/libtmux-load_buffer/

```
load_buffer(
    connection::LibTmux.ControlConnection,
    bytes::AbstractVector{UInt8};
    kwargs...
)

load_buffer(server::LibTmux.Server, bytes::AbstractVector{UInt8}; kwargs...)
```

## Methods

### `load_buffer` (overload 1)

```julia
load_buffer(
    connection::LibTmux.ControlConnection,
    bytes::AbstractVector{UInt8};
    kwargs...
)
```

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/control_buffers.jl#L68).

Load nonempty bytes through a private local file on the pinned daemon. The caller owns the returned random buffer and releases it with `delete_buffer`. Bytes never pass through the control reply grammar. The daemon must share the local filesystem; its file I/O may block its event loop. Timeout and cancellation follow the other typed control methods. Failed submissions attempt separate, uncancelled 900 ms buffer cleanup; unresolved cleanup retains the buffer in `ControlBufferCleanupError`. Local files are removed on every exit.

```julia
load_buffer(connection::ControlConnection, bytes; kwargs...) -> BufferRef
```

### `load_buffer(server::LibTmux.Server, bytes::AbstractVector{UInt8}; kwargs...)`

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/pane_io.jl#L182).

Load nonempty bytes through stdin into a randomly named, generation-bound buffer. Existing names are checked before creation. The caller owns the returned buffer and releases it with `delete_buffer`; no finalizer performs remote I/O. Empty input errors because tmux does not create empty buffers.

```julia
load_buffer(server, bytes; kwargs...) -> BufferRef
```

## Parameters

- `connection` (`LibTmux.ControlConnection`) (for `load_buffer(connection, bytes, kwargs)`)
- `bytes` (`Base.AbstractVector{UInt8}`)
- `kwargs`
- `server` (`LibTmux.Server`) (for `load_buffer(server, bytes, kwargs)`)
