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

Session.cmd

Execute tmux subcommand within session context.

Source and package
Qualified name
libtmux.Session.cmd
Module
libtmux
Declared in
Session
Package
libtmux
Source
src/libtmux/session.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 session ID to the command. Pass target to keyword arguments to override.

Examples#

>>> session.cmd('new-window', '-P').stdout[0]
'libtmux...:....0'

From raw output to an enriched Window object:

>>> Window.from_window_id(window_id=session.cmd(
... 'new-window', '-P', '-F#{window_id}').stdout[0], server=session.server)
Window(@... ...:..., Session($1 libtmux_...))
Parameters
Returns

server.cmd

In other ports Run a tmux command addressed at a session
  • 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 Session
  • C#
    no equivalent on Session
  • C++
    no equivalent on Session
  • Swift
    no equivalent on Session
  • 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