On this page
libtmux.exc.NotInsideTmux
- Module
- libtmux.exc
- Package
- libtmux
- Source
- src/libtmux/exc.py
- Bases:
Raised when the process is not running inside a tmux pane.
tmux exports
$TMUXand$TMUX_PANEinto the environment of every pane it spawns. Thefrom_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
LibTmuxExceptionhierarchy:>>> issubclass(exc.NotInsideTmux, exc.LibTmuxException) True
1 declared, 1 inherited
Members
- __init__ method
Inherited members
Reached through libtmux.exc.LibTmuxException.
- __str__ libtmux.exc.LibTmuxException Render with optional
"<subcommand>: …"prefix.