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

server.Server.pipeline

TypeScript
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript
  • Rust Unavailable
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

View as Markdown

Module
server
Declared in
Server
Package
libtmux
Source
packages/libtmux/src/server.ts
pipeline ( commands : : readonly (readonly string[])[] , options : : CommandOptions ) → Promise<readonly (readonly string[])[]>
method [source]
method [source]
pipeline

Run several tmux commands in order.

The result is positional: results[i] holds what commands[i] printed, empty for a command that prints nothing. Commands run as separate tmux invocations because arbitrary command output has no alias-independent delimiter.

Not atomic. tmux runs the commands in order and stops at the first failure, leaving everything before it applied; the error names the command that failed. Take a Server.snapshot afterwards if you need to know what survived.

Examples

const [[first], [second]] = await server.pipeline([
["new-window", "-d", "-P", "-F", "#{window_id}"],
["new-window", "-d", "-P", "-F", "#{window_id}"],
]);

Discussed in Control mode vs one-shot

0 declared, 0 inherited

Esc

Type to search.