AntonGepting / tmux-interface-rs

Rust language library for communication with TMUX via CLI
MIT License
51 stars 5 forks source link

How to send keys to your tmux session with this project? #19

Closed SpiderUnderUrBed closed 3 weeks ago

SpiderUnderUrBed commented 3 weeks ago

Hi, I am curious, is this possible? To send key input to your tmux screen via this project.

AntonGepting commented 3 weeks ago

Hi,

since the commands part of the library is just a wrapper around the tmux CLI, you can just use the corresponding functions (e.g. the SendKeys struct for the send-keys tmux command)

Example

...

// tmux send-keys abc
Tmux::new()
    .add_command(SendKeys::new().key("abc"))
    .output()
    .unwrap();
...