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

Pane.waitForExit

Resolve with how this pane's program ended, whoever started it.

Source and package
Qualified name
Pane.waitForExit
Module
pane
Declared in
Pane
Package
libtmux
Source
packages/libtmux/src/pane.ts

Description#

At once for a pane already dead under remain-on-exit; otherwise when tmux reports the exit, with the status a closing pane takes with it. A signal that ended the pane's process shows as signalCode with exitCode null. Giving up leaves the program running: a timeout throws WaitTimeoutError and an abort throws TmuxTransportError of kind cancelled; with neither it waits as long as the program runs. A pane killed from outside, which fires no event, raises ObjectNotFoundError within about two seconds: one to notice, and one for the event a closing pane fires to arrive.

Requires tmux 3.8 or newer.

Examples#

const build = await window.split({ shellCommand: "sleep 1; exit 3" });
const exit = await build.waitForExit({ timeoutMs: 10_000 });
exit.exitCode; // 3
Parameters
Esc

Type to search.

Reference previewOpen reference