Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

pane.Pane.cmd

TypeScript

View as Markdown

Module
pane
Declared in
Pane
Package
libtmux
Source
packages/libtmux/src/pane.ts
Other languages
Python Ruby Lua RustGo Java .NET C++ Swift
cmd ( command : : string , args : : readonly string[] = [] , options : : CmdOptions ) → Promise<readonly string[]>
method [source]
method [source]
cmd

Run a tmux command this package does not model, addressed at this pane.

The pane's id is sent as the target; pass target to address something else, or null for a command that takes none.

In other ports Run a tmux command addressed at a pane
  • Python libtmux.Pane.cmd
  • Ruby No source-verified Ruby equivalent is recorded for this operation.
  • Lua No source-verified Lua equivalent is recorded for this operation.
  • Rust pane.Pane.cmd
  • Go tmux.Pane.Cmd
  • Java no equivalent on Pane
  • .NET no equivalent on Pane
  • C++ no equivalent on Pane
  • Swift no equivalent on Pane

Examples

await pane.cmd("clock-mode");
>>> pane.cmd('split-window', '-P').stdout[0]
'libtmux...:...'

From raw output to an enriched Pane object:

>>> Pane.from_pane_id(pane_id=pane.cmd(
... 'split-window', '-P', '-F#{pane_id}').stdout[0], server=pane.server)
Pane(%... Window(@... ...:..., Session($1 libtmux_...)))
let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("raw").await?;
let window = session.active_window().await?.expect("a window");
let pane = window.active_pane().await?.expect("a pane");
let result = pane
.cmd(libtmux::Command::new("display-message").arg("-p").arg("#{pane_id}"))
.await?;
assert_eq!(result.stdout_lossy().trim(), pane.id().to_string());
guard.shutdown().await?;

0 declared, 0 inherited

Esc

Type to search.