Program
A program started by Server.spawn , running in a pane of its own.
Source and package
- Qualified name
-
Program - Module
- program
- Package
- libtmux
- Source
- packages/libtmux/src/program.ts
-
Description#
Drive a full-screen program with
Pane.sendKeysand read its screen withPane.capture.It owns its pane.
Program.kill, or leaving anawait usingscope, ends the program and removes the pane, unless spawned withkeep. Should this process exit or die first, tmux ends the program through its lease, unless spawned withorphanAfterMs: null. A kill ends a stream in progress withLibTmuxError, and a pane removed from outside withObjectNotFoundError. Afterkill,outputraisesObjectNotFoundError,streamraisesLibTmuxError, andwaitreturns the exit it already saw or raisesObjectNotFoundError.Requires tmux 3.8 or newer.
Members9#
Common operations7#
- [Symbol.asyncDispose] method Kill the program when an
await usingscope ends. - kill method End the program and remove its pane, unless kept.
- output method What the program has printed so far, as its terminal shows it.
- pane: Pane attribute The pane the program runs in.
- sessionName: string attribute The session the program runs in: a detached one of its own, removed with it, or with
fromthat pane's session, which loses only the program's window or split.tmux attach -tit to watch the program. - stream method Everything the program writes, as UTF-8 text in the order it was written, until it exits and its last write has arrived.
- wait method Resolve with how the program ended, once it has. The pane stays, for
Program.output, untilProgram.killorawait using. A program that never ran, becauseargv[0]was not found or is not executable, orstartDirectorycould not be entered, rejects every wait withProgramStartError, and its stream ends with it.
Other members2#
- constructor method
- programBrand: undefined attribute