# tmux_operation:cancel/1

- **Package:** libtmux_erlang
- **Language:** Erlang
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-erlang/blob/d1b6308440cf9eb8f6647e7ae434bce60e849368/apps/libtmux_erlang/src/tmux_operation.erl#L117
- **Page:** https://libtmux.org/en/erlang/latest/reference/tmux_operation-cancel-1/

```
cancel(Operation)
-spec cancel(t()) ->
                {ok,
                 cancelled_before_send | cancel_requested |
                 already_completed} |
                {error, map()}.
```

Request cancellation using this handle. Any holder can cancel; only the owner can transfer ownership. Queued work can be cancelled before submission; possibly sent work retires its client and can retain an unknown tmux outcome. Use `await/2` for the result and cleanup proof. Never infer rollback or automatically retry a mutation from cancellation alone. already_completed means a response exists; it does not establish complete cleanup.

## Parameters

- `Operation` (`t()`)
