typealias libtmux-ts
ShellCommandResult
The outcome and bounded output of a command run in an existing pane shell.
Source and package
- Qualified name
-
ShellCommand Result - Module
- shell-command
- Package
- libtmux
- Source
- packages/libtmux/src/shell-command.ts
- type shell-command.ShellCommandResult = Shell
Command & ( | { readonly exitStatus: number; readonly outcome: "completed" } | { readonly exitStatus: null; readonly outcome: "cancelled" | "pane_died" | "timed_out"; } )Evidence -
Description
A completed result carries the exit status from the command's own frame. A timeout or cancellation can leave accepted input for the shell to run. Check
outputCompletebefore using the output as a full transcript.Examples
import type { ShellCommandResult } from "libtmux";const session = await server.newSession({ shellCommand: "exec sh -i" });try {const result: ShellCommandResult = await session.panes.one().runCommand("printf ready");if (result.outcome === "completed" && result.outputComplete) console.log(result.output);} finally {await session.kill();}