libtmux Reference MCP Search
On this page

libtmux.neo._is_target_not_found_error

View as Markdown

Module
libtmux.neo
Package
libtmux
Source
src/libtmux/neo.py
_is_target_not_found_error ( stderr_text : str ) bool
function [source]
function [source]
_is_target_not_found_error

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

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.

0 declared, 0 inherited

Esc

Type to search.