Compare commits

..

2 commits

Author SHA1 Message Date
c865c2d1ab version bump 2024-07-12 09:19:30 -04:00
6ce1f354c4 added env var to disable 'new' command from running rc 2024-07-12 09:19:04 -04:00
3 changed files with 12 additions and 8 deletions

View file

@ -1,6 +1,6 @@
[package] [package]
name = "remux" name = "remux"
version = "0.3.5" version = "0.3.6"
edition = "2021" edition = "2021"
authors = [ "Valerie Wolfe <sleeplessval@gmail.com>" ] authors = [ "Valerie Wolfe <sleeplessval@gmail.com>" ]
description = "A friendly command shortener for tmux" description = "A friendly command shortener for tmux"

View file

@ -188,6 +188,8 @@ pub fn new(state: &mut State) {
.new_name(&window_name); .new_name(&window_name);
tmux = tmux.add_command(auto_name); tmux = tmux.add_command(auto_name);
let rc_var = env_var(env::NEW_RC);
if !(rc_var.is_empty() || rc_var == "0") {
if let Some(mut scripts) = script::list() { if let Some(mut scripts) = script::list() {
if let Some(path) = scripts.remove(&window_name) { if let Some(path) = scripts.remove(&window_name) {
let rc = commands::SourceFile::new() let rc = commands::SourceFile::new()
@ -196,6 +198,7 @@ pub fn new(state: &mut State) {
} }
} }
} }
}
tmux.stderr(NULL).output().ok(); tmux.stderr(NULL).output().ok();
} }

View file

@ -5,6 +5,7 @@ pub type EnvVar = (&'static str, &'static str);
pub static ATTACH_SYMBOL: EnvVar = ("REMUX_ATTACH_SYMBOL", "*"); pub static ATTACH_SYMBOL: EnvVar = ("REMUX_ATTACH_SYMBOL", "*");
pub static CURRENT_SYMBOL: EnvVar = ("REMUX_CURRENT_SYMBOL", ">"); pub static CURRENT_SYMBOL: EnvVar = ("REMUX_CURRENT_SYMBOL", ">");
pub static NEW_WINDOW_NAME: EnvVar = ("REMUX_NEW_WINDOW", ""); pub static NEW_WINDOW_NAME: EnvVar = ("REMUX_NEW_WINDOW", "");
pub static NEW_RC: EnvVar = ("REMUX_NEW_RC", "1");
pub static TMUX: &str = "TMUX"; pub static TMUX: &str = "TMUX";