Core LibraryalphaTopics

Choose documentation 3

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

Edit this page on GitHub

Errors and exceptions

A command can fail because tmux rejects it, or because the transport stops before returning a reply. Inspect the reported error and delivery state before retrying a mutation: tmux may already have received it.

For lookup failures caused by zero or multiple matches, see Filtering and queries.

A failed command, as a value

Fallible operations return Result<T, Error>. Match the non-exhaustive Error enum and include a fallback for variants added later.

Is it safe to retry?

Retry a mutation automatically only when you know it was not dispatched, or when repeating it is safe for your operation. A timeout, cancellation, or dropped connection can occur after tmux has acted. These APIs expose delivery information:

With the control-mode feature, ControlModeErrorKind.DispatchTimedOut means the command was not dispatched. A plain timeout can occur after tmux received the command, so do not infer that retrying is safe.

Treat unknown delivery as potentially executed.

DispatchTimedOut identifies a request that did not reach tmux.

For subprocess calls that complete normally, inspect the exit status. If a call is interrupted or times out without a delivery state, check tmux’s resulting state before repeating a mutation.

Esc

Type to search.

Reference preview Open reference