tmux_interface
is a library for communication with
TMUX via CLI written in
Rust programming language. The crate
documentation can be found on the
docs.rs page.
Add a dependency in your Cargo.toml
. Versions below 1.0.0
are
mostly for development and testing purposes (use them in your projects on
your own risk, further versions may have different API).
text
[dependencies]
tmux_interface = "1.0.0"
Add extern crate in your source file.
extern crate tmux_interface;
Use it's functions
### Example 1 ``` use tmux_interface::{HasSession, KillSession, NewSession, NewWindow, SplitWindow, Tmux};
let targetsession = "example1";
// tmux new -d -s example1 ; neww ; splitw -v Tmux::new() .addcommand(NewSession::new().detached().sessionname(targetsession)) .addcommand(NewWindow::new()) .addcommand(SplitWindow::new().vertical()) .output() .unwrap();
// tmux has -t example1 let status = Tmux::withcommand(HasSession::new().targetsession(targetsession)) .status() .unwrap() .success();
assert!(status);
// tmux kill-session -t example1 Tmux::withcommand(KillSession::new().targetsession(targetsession)) .output() .unwrap();
```
The library is still in experimental development stage (unstable). - many features are unimplemented or not well tested - some APIs/structures/names/... can be changed in the future - some design patterns of the library can be changed - almost all library documentation is missing at the moment - ...
The library was tested using GitHub Actions under following conditions:
OS:
Rust:
Tmux (covered tmux versions crate features):
tmux_X_X
tmux_3_3a
tmux_3_3
tmux_3_2a
tmux_3_2
tmux_3_1c
tmux_3_1b
tmux_3_1a
tmux_3_1
tmux_3_0a
tmux_3_0
tmux_2_9a
tmux_2_9
tmux_2_8
tmux_2_7
tmux_2_6
tmux_2_5
tmux_2_4
tmux_2_3
tmux_2_2
tmux_2_1
tmux_2_0
tmux_1_9a
tmux_1_9
tmux_1_8
tmux_1_7
tmux_1_6
tmux_1_5
tmux_1_4
- tmux compilation errortmux_1_3
- tmux compilation errortmux_1_2
- tmux compilation errortmux_1_1
- tmux compilation errortmux_1_0
- tmux compilation errortmux_0_9
- tmux compilation errortmux_0_8
- tmux compilation errortmux_interface
library is licensed under the MIT license. Please read the
license file in the repository for more information.