pane_id_from_env
Return the pane id recorded in $TMUX_PANE.
Source and package
- Qualified name
-
libtmux._internal .env .pane _id _from _env - Module
- libtmux._internal.env
- Package
- libtmux
- Source
- src/libtmux/_internal/env.py
-
Description#
The
%sigil is load-bearing: libtmux passes this id straight to tmux as a-ttarget, and tmux'scmd_findroutes a target to its pane slot by sigil. A sigil-less value would be matched against session names instead, silently resolving to the wrong object.Examples#
>>> from libtmux._internal.env import pane_id_from_env>>> pane_id_from_env({"TMUX_PANE": "%3"})'%3'>>> pane_id_from_env({})Traceback (most recent call last):...libtmux.exc.NotInsideTmux: Not inside a tmux pane: $TMUX_PANE is unset or empty>>> pane_id_from_env({"TMUX_PANE": "3"})Traceback (most recent call last):...libtmux.exc.NotInsideTmux: Not inside a tmux pane: $TMUX_PANE is not a pane id...- Parameters
- Returns
-
str The pane id, e.g.
"%3". - Raises
-
-
Not
Inside – WhenTmux $TMUX_PANEis unset, empty, or is not a%-prefixed id.
-