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.

exception libtmux stable

NotInsideTmux

Raised when the process is not running inside a tmux pane.

Base types LibTmuxException
Source and package
Qualified name
libtmux.exc.NotInsideTmux
Module
libtmux.exc
Package
libtmux
Source
src/libtmux/exc.py
exception libtmux.exc.NotInsideTmux

Description#

tmux exports $TMUX and $TMUX_PANE into the environment of every pane it spawns. The from_env() family raises this when one of them is missing or malformed -- i.e. the caller is not (or is no longer) recognizable as a tmux pane's child process.

Examples#

>>> from libtmux import exc
>>> str(exc.NotInsideTmux("TMUX"))
'Not inside a tmux pane: $TMUX is unset or empty'
>>> str(exc.NotInsideTmux("TMUX_PANE", reason="not a pane id"))
'Not inside a tmux pane: $TMUX_PANE is not a pane id'
>>> str(exc.NotInsideTmux())
'Not inside a tmux pane'

It is part of the LibTmuxException hierarchy:

>>> issubclass(exc.NotInsideTmux, exc.LibTmuxException)
True

Discussed in Environment

Members1#

Inherited members1 member#

Reached through libtmux.exc.LibTmuxException.

Esc

Type to search.

Reference preview Open reference