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

libtmux.common.tmux_cmd

Python
  • Python
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust Unavailable
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

View as Markdown

Module
libtmux.common
Package
libtmux
Source
src/libtmux/common.py
class libtmux.common.tmux_cmd
class [source]
class [source]
class libtmux.common.tmux_cmd

Run any tmux(1) command through subprocess.

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

1 declared, 0 inherited

Members

Esc

Type to search.