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.

function libtmux stable

_is_target_not_found_error

Return True if tmux failed because the -t target does not exist.

Source and package
Qualified name
libtmux.neo._is_target_not_found_error
Module
libtmux.neo
Package
libtmux
Source
src/libtmux/neo.py
_is_target_not_found_error (stderr_text: str) → bool

Description#

A live tmux server rejects an unknown target with can't find <kind>: <target> on stderr (cmd_find_target in tmux's cmd-find.c), for every object kind and every supported tmux version. Every other failure -- a stopped daemon, a missing socket, a permission error -- says something else, and stays a LibTmuxException .

This is the mirror image of libtmux.server._is_daemon_not_up_error : together they answer "is the object gone, or is the server gone?" from the same stderr text.

Examples#

>>> from libtmux.neo import _is_target_not_found_error
>>> _is_target_not_found_error("can't find pane: %99")
True
>>> _is_target_not_found_error("can't find window: @99")
True
>>> _is_target_not_found_error("can't find session: $99")
True

A server that isn't there is a different answer:

>>> _is_target_not_found_error("no server running on /tmp/tmux-1000/default")
False
>>> _is_target_not_found_error(
... "error connecting to /tmp/tmux-1000/nope (No such file or directory)"
... )
False
Parameters
Returns

bool True when the object named by -t does not exist on a reachable server.

Esc

Type to search.

Reference preview Open reference