Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

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

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");