Core LibrarystableAPI Reference

Choose documentation 3

stable

Current version

stable
English

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

Python API

method libtmux stable

Window.cmd

Execute tmux subcommand within window context.

Source and package
Qualified name
libtmux.Window.cmd
Module
libtmux
Declared in
Window
Package
libtmux
Source
src/libtmux/window.py
Other languages
PowerShell Julia Ruby Lua TypeScriptRustGo Java C# C++ Swift Kotlin Scala F#
cmd ( self, cmd: str, args: t.Any, target: str | int | None = None, ) → tmux_cmd

Description#

Automatically binds target by adding -t for object's window ID to the command. Pass target to keyword arguments to override.

Examples#

Create a pane from a window:

>>> window.cmd('split-window', '-P', '-F#{pane_id}').stdout[0]
'%...'

Magic, directly to a Pane :

>>> Pane.from_pane_id(pane_id=session.cmd(
... 'split-window', '-P', '-F#{pane_id}').stdout[0], server=session.server)
Pane(%... Window(@... ...:..., Session($1 libtmux_...)))
Parameters
Returns

server.cmd

In other ports Run a tmux command addressed at a window
  • PowerShell
    No source-verified PowerShell equivalent is recorded for this operation.
  • Julia
    No source-verified Julia equivalent is recorded for this operation.
  • Ruby
    No source-verified Ruby equivalent is recorded for this operation.
  • Lua
    No source-verified Lua equivalent is recorded for this operation.
  • TypeScript
  • Rust
  • Go
  • Java
    no equivalent on Window
  • C#
    no equivalent on Window
  • C++
    no equivalent on Window
  • Swift
    no equivalent on Window
  • Kotlin
    No source-verified Kotlin equivalent is recorded for this operation.
  • Scala
    No source-verified Scala equivalent is recorded for this operation.
  • F#
    No source-verified F# equivalent is recorded for this operation.
Esc

Type to search.

Reference preview Open reference