home ~ projects ~ socials

Try To Set A Tmux Window Name In Rust

I add this to my terminal apps to set the name of tmux windows to make it easier to remember what's what

The Code

use std::process::Command;

pub fn try_to_set_tmux_title(title: &str) {
    let args: Vec<&str> = vec!["select-pane", "-T", title];
    let _ = Command::new("tmux").args(args).output().unwrap();
}

Usage

try_to_set_tmux_title("Some App Name");

-- end of line --