tmux_interface is a Rust language library for communication with TMUX via CLI.
Add a dependency in your Cargo.toml
[dependencies]
tmux_interface = "^0.1.0"
Add extern crate and use in your source file
extern crate tmux_interface;
Use it's functions ``` use tmux_interface::{AttachSession, NewSession, TmuxInterface};
let mut tmux = TmuxInterface::new(); let newsession = NewSession { detached: Some(true), sessionname: Some("sessionname"), ..Default::default() }; tmux.newsession(Some(&newsession)).unwrap(); let attachsession = AttachSession { targetsession: Some("sessionname"), ..Default::default() }; tmux.attachsession(Some(&attach)).unwrap(); tmux.killsession(None, None, Some("session_name")).unwrap(); ```
Versions below 0.1.0
are first public releases, mostly for development
and testing purposes. Do not use them in your Projects.
Used in mosaic - tmux manager
The library was tested under following conditions.
Tmux: - tmux 3.0a
Rust: - stable (manually, Travis CI) - beta (Travis CI) - nightly (Travis CI)
OS: - Debian 11 Bullseye, x64 (manually) - Ubuntu 16.04 Xenial Xerus, x64 (Travis CI) - MacOS 10.13.6 High Sierra, x64 (Travis CI)
src/
- crate sources
Common:
tmux_interface.rs
- common functionserror.rs
- error propagating functionslib.rs
- main library fileTMUX functions (structure similar to TMUX manual):
Unit tests for functions and their parts:
Parsing functions:
sessions.rs
- parse a session listsession.rs
- parse a sessionsession_stack.rs
- session stackwindows.rs
- parse a windows listwindow.rs
- parse a windowwindow_flag.rs
- window flagpanes.rs
- parse a panes listpane.rs
- parse a panepane_tabs.rs
- pane tabstmux_option.rs
- parse an optionversion.rs
- parse version responselayout_cell.rs
- parse layout cell stringlayout_checksum.rs
- calculate layout checksumlayout.rs
- parse layot tree stringUnit tests for parsing functions:
tests/
- crate integration tests (multiple functions):
issue1.rs
- issue #1 testssessions_tests.rs
- sessions testswindows_tests.rs
- windows testspanes_tests.rs
- panes teststmux_error_mock.sh
- bash script for testing of tmux error handling functionstmux_interface.rs
tmux_mock.sh
- bash script can be used instead of tmux binary, for simple logging
(sniffing) intercommmunication between library functions and tmuxtmux_test.sh
- bash script for output testing of tmux functionsCargo.toml
- crate configuration (File Format)
CHANGELOG.md
- version historyclippy.toml
- Clippy configuration file (Clippy).editorconfig
- consistent coding style configuration (File Format)LICENSE.md
- license textREADME.md
- common information (this file)ROADMAP.md
- future goals, wishlist, ideasrustfmt.toml
- rustfmt configuration file (rustfmt)rust-toolchain
- rustup toolchain configuration file (rustup).travis.yml
- travis CI configuration (File Format)If you are interested in this project and you have:
You are allways welcome, please feel free to use following links to contact me and/or to contribute to the project:
tmux_interface is licensed under the MIT license. Please read the license file in this repository for more information.