libtmux Reference MCP Search
On this page

server.Server.batch

View as Markdown

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

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

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" }),
]);

Discussed in Control mode vs one-shot

0 declared, 0 inherited

Esc

Type to search.