Pane.waitForExit
Resolve with how this pane's program ended, whoever started it.
Source and package
- Qualified name
-
Pane.wait For Exit - Module
- pane
- Declared in
- Pane
- Package
- libtmux
- Source
- packages/libtmux/src/pane.ts
- waitForExit( options?: Program
Wait , ): Promise<ProgramOptions Exit > -
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 assignalCodewithexitCodenull. Giving up leaves the program running: a timeout throwsWaitTimeoutErrorand an abort throwsTmuxTransportErrorof kindcancelled; with neither it waits as long as the program runs. A pane killed from outside, which fires no event, raisesObjectNotFoundErrorwithin 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