Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux-rs latest

Server.resolved_tmux_executable

Resolve the configured tmux executable from the captured launch context.

Source and package
Qualified name
libtmux::server::Server::resolved_tmux_executable
Module
server
Declared in
Server
Package
libtmux
Source
crates/libtmux/src/server.rs
#[must_use] pub fn resolved_tmux_executable(&self) -> Option<PathBuf>

Description#

Bare names use the PATH captured by ServerBuilder::build(). Relative paths use its captured working directory. The returned path preserves a configured wrapper or symlink rather than canonicalizing it.

Returns None when the configured executable is not on the captured PATH, so a caller can tell "tmux is missing" from "tmux failed".

Examples#

// Any absolute path is resolved only if it is a runnable file, so this
// example names one POSIX guarantees rather than tmux's own location,
// which varies by platform.
let server = libtmux::Server::builder()
.tmux_executable("/bin/sh")
.build()?;
assert_eq!(
server.resolved_tmux_executable(),
Some(std::path::PathBuf::from("/bin/sh")),
);
let missing = libtmux::Server::builder()
.tmux_executable("tmux-that-is-not-installed")
.build()?;
assert_eq!(missing.resolved_tmux_executable(), None);
Esc

Type to search.

Reference previewOpen reference