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.

MoreLess about this notice

method libtmux-ts

Pane.runCommand

Run one framed command in this pane's existing POSIX shell.

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

Description

The command inherits the shell's directory, variables and functions. It runs in a subshell, so changes leave the interactive shell where it was. An exit status requires the command's own frame. A shell's OSC 133 completion is additional evidence while the observation is open.

Read outcome and outputComplete before using the bounded output. Another writer can change shell state or print between the markers. foreignOutputSuspected reports foreign framing when visible. A timeout or cancellation stops waiting. The shell can still execute input that tmux already accepted. Check delivery before sending another command.

Parameters
Errors

Examples

const session = await server.newSession({ shellCommand: "exec sh -i" });
const result = await session.activePane?.runCommand("printf 'hello'");
result?.output; // "hello"

Recorded calls

source calls
No call edges in the TypeScript model.

The TypeScript reference records declarations, not calls, so this page shows no callers or callees. That is a limit of the extracted data, not a statement that nothing calls pane.Pane.runCommand.

Esc
Search in

Type to search.

Reference previewOpen reference