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

target.SessionName

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.SessionName
structoverload [source]
structoverload [source]
struct target.SessionName

A session name tmux can address.

tmux will happily create a session whose name holds : or , and then cannot find it again: those are its target separators, so it splits the name before looking anything up.

The session exists and cannot be killed by its own name. An empty name is rejected for the same reason: an empty target means "the current one".

Examples

Terminal window
$ tmux new-session -d -s 'a:b' # accepted
$ tmux has-session -t 'a:b'
can't find window: b
$ tmux kill-session -t 'a:b'
can't find window: b
use libtmux::SessionName;
assert!(SessionName::new("build").is_ok());
assert!(SessionName::new("a:b").is_err());
assert!(SessionName::new("c.d").is_err());
assert!(SessionName::new("").is_err());
// Everything else tmux accepts is kept, including what looks awkward.
assert!(SessionName::new("has,comma").is_ok());
assert!(SessionName::new("has space").is_ok());

2 declared, 0 inherited

Members

  • as_str method Borrow the name.
  • new method Check a name tmux will be able to address.
Esc

Type to search.