Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux-ts latest

Server.batch

Run planned mutations in order, resolving each to what it made.

Source and package
Qualified name
Server.batch
Module
server
Declared in
Server
Package
libtmux
Source
packages/libtmux/src/server.ts
async batch< const T extends readonly PlannedOperation<unknown>[], >( operations: T, options?: CommandOptions, ): Promise<{ -readonly [K in keyof T]: T[K] extends PlannedOperation< infer R > ? R : never; }>

Description#

The batched form of calling them one at a time: the same options go in and the same handles come out, positionally and individually typed. Calling newWindow() repeatedly takes one snapshot after each mutation; a batch runs the mutations in order and resolves all of them from one final snapshot.

Not atomic, for the same reason Server.pipeline() is not: tmux runs them in order and stops at the first failure, leaving everything before it applied.

Examples#

const [editor, logs] = await server.batch([
session.plan.newWindow({ name: "editor" }),
session.plan.newWindow({ name: "logs" }),
]);
Type parameters
Parameters

Guides#

Pages that discuss batch.

Esc

Type to search.

Reference previewOpen reference