Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

mcp.caller.CallerIdentity

Rust
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

API reference · Markdown

struct mcp.caller.CallerIdentity
structoverload [source]
structoverload [source]
struct mcp.caller.CallerIdentity

The tmux pane hosting this process, as its environment describes it.

TMUX carries socket_path,server_pid,session_number; TMUX_PANE carries the pane id. Either both variables form one complete identity or the context is malformed; only two absent variables mean detached operation, and an empty variable counts as absent.

Members

from_env

from_env ( ) → Option<Self>
method [source]
method [source]
from_env

Read the identity from this process's environment.

Returns None when neither variable is set, which is the ordinary case for a server started outside tmux.

from_values

from_values ( tmux : Option<OsString> , pane : Option<OsString> ) → Option<Self>
method [source]
method [source]
from_values

Build an identity from explicit values, as the environment would give them.

Separate from CallerIdentity::from_env so the parsing can be tested without a process-wide environment, which no test can hold alone.

is_malformed

is_malformed ( self ) → bool
method [source]
method [source]
is_malformed

Whether the variables were set but do not describe one tmux pane.

Pane-input and teardown tools refuse every call while this holds, because they cannot rule out reaching the caller's own pane.

pane_id

pane_id ( self ) → Option<&str>
method [source]
method [source]
pane_id

The pane this process runs in, when tmux named one.

socket

socket ( self ) → Option<&Path>
method [source]
method [source]
socket

The socket path this process was started from, when tmux named one.

relation_to

relation_to ( self , pane_id : &str , server_socket : Option<&Path> ) → Relation
method [source]
method [source]
relation_to

Whether a pane on the given server is provably this process's own.

Positive only on a confirmed socket match, because this drives an annotation an agent reads as fact. Anything less is Relation::Other : a bare pane-id match across two sockets is the false positive this whole module exists to avoid.

may_be_on

may_be_on ( self , server_socket : Option<&Path> , _socket_name : Option<&str> ) → bool
method [source]
method [source]
may_be_on

Whether this process might be running on the given server.

Malformed context and an unreadable target socket remain protected. Complete identities on a different physical socket are foreign; a socket basename alone never authenticates a caller.

Esc

Type to search.