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

target.TmuxArg

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

View as Markdown

Module
target
Package
libtmux
Source
crates/libtmux/src/target.rs
struct target.TmuxArg
structoverload [source]
structoverload [source]
struct target.TmuxArg

Text bound for a tmux argument that tmux expands as a format.

tmux runs its format machinery over a session or window name, a pane title, and a -c start directory before it uses them, so #(command) in caller text runs a shell. Every such argument in this crate takes this type, and every conversion into it escapes: text a program did not write arrives as itself, and asking for expansion is a visible call to TmuxArg::format .

Examples

use libtmux::TmuxArg;
// The ordinary path. `From` escapes, so tmux stores what was asked.
let literal = TmuxArg::from("release#1");
assert_eq!(literal.as_os_str(), "release##1");
// Expansion is opt-in and reads as such.
let expanded = TmuxArg::format("#{pane_current_path}");
assert_eq!(expanded.as_os_str(), "#{pane_current_path}");

3 declared, 0 inherited

Members

  • as_os_str method Borrow the bytes as they will reach tmux, escaped or not.
  • format method Send template for tmux to expand as a format.
  • literal method Send text literally, escaping what tmux would otherwise expand.
Esc

Type to search.