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.

Python API

class libtmux latest

tmux_cmd

Run any tmux(1) command through subprocess.

Source and package
Qualified name
libtmux.common.tmux_cmd
Module
libtmux.common
Package
libtmux
Source
src/libtmux/common.py
class libtmux.common.tmux_cmd

Examples#

Create a new session, check for error:

>>> proc = tmux_cmd(f'-L{server.socket_name}', 'new-session', '-d', '-P', '-F#S')
>>> if proc.stderr:
... raise exc.LibTmuxException(
... 'Command: %s returned error: %s' % (proc.cmd, proc.stderr)
... )
...
>>> print(f'tmux command returned {" ".join(proc.stdout)}')
tmux command returned 2

Members1#

Esc

Type to search.

Reference previewOpen reference