# LibTmux.paste_bytes

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

```
paste_bytes(
    connection::LibTmux.ControlConnection,
    pane::LibTmux.PaneRef,
    bytes::AbstractVector{UInt8};
    bracketed,
    kwargs...
)

paste_bytes(
    server::LibTmux.Server,
    pane::LibTmux.PaneRef,
    bytes::AbstractVector{UInt8};
    bracketed,
    kwargs...
)
```

## Methods

### `paste_bytes` (overload 1)

```julia
paste_bytes(
    connection::LibTmux.ControlConnection,
    pane::LibTmux.PaneRef,
    bytes::AbstractVector{UInt8};
    bracketed,
    kwargs...
)
```

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

Paste exact buffer bytes through the pinned connection without appending Enter or converting LF to CR. Bracketed paste and application transformations follow the subprocess method. A private file and randomly named buffer carry the data; success, failure and cancellation attempt uncancelled 900 ms remote cleanup. Cleanup failure retains its buffer reference alongside any primary error. Already-delivered input cannot be rolled back. Empty input validates the local reference and returns `nothing` without submitting a command.

```julia
paste_bytes(connection::ControlConnection, pane::PaneRef, bytes; bracketed=false, kwargs...)
```

### `paste_bytes` (overload 2)

```julia
paste_bytes(
    server::LibTmux.Server,
    pane::LibTmux.PaneRef,
    bytes::AbstractVector{UInt8};
    bracketed,
    kwargs...
)
```

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

Paste through a temporary owned buffer, retaining LF rather than converting it to CR. `bracketed=true` requests bracketed paste when the application has enabled it. No Enter is appended. tmux receives exact buffer bytes, but the terminal driver and target application can transform them.

```julia
paste_bytes(server, pane, bytes; bracketed=false, kwargs...)
```



Success, failure and cancellation attempt bounded cleanup of only the new buffer with an uncancelled 900 ms context. A cleanup failure preserves the original error in `CompositeException`. Subprocess generation checks remain best effort; input already delivered to the pane cannot be rolled back. Empty bytes validate the target and return `nothing` without sending input.

## Parameters

- `connection` (`LibTmux.ControlConnection`) (for `paste_bytes(connection, pane, bytes, bracketed, kwargs)`)
- `pane` (`LibTmux.PaneRef`)
- `bytes` (`Base.AbstractVector{UInt8}`)
- `bracketed` (`Bool`)
  Default: `false`.
- `kwargs`
- `server` (`LibTmux.Server`) (for `paste_bytes(server, pane, bytes, bracketed, kwargs)`)
