target.SessionName
Rust
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- target
- Package
- libtmux
- Source
- crates/libtmux/src/target.rs
-
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: buse 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