diff --git a/src/command/share.rs b/src/command/share.rs index 556d178..e4e5c50 100644 --- a/src/command/share.rs +++ b/src/command/share.rs @@ -188,11 +188,14 @@ pub fn new(state: &mut State) { .new_name(&window_name); tmux = tmux.add_command(auto_name); - if let Some(mut scripts) = script::list() { - if let Some(path) = scripts.remove(&window_name) { - let rc = commands::SourceFile::new() - .path(path); - tmux = tmux.add_command(rc); + 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(path) = scripts.remove(&window_name) { + let rc = commands::SourceFile::new() + .path(path); + tmux = tmux.add_command(rc); + } } } } diff --git a/src/env.rs b/src/env.rs index 37bc192..eb16074 100644 --- a/src/env.rs +++ b/src/env.rs @@ -2,9 +2,10 @@ use std::env::var; pub type EnvVar = (&'static str, &'static str); -pub static ATTACH_SYMBOL: EnvVar = ("REMUX_ATTACH_SYMBOL", "*"); -pub static CURRENT_SYMBOL: EnvVar = ("REMUX_CURRENT_SYMBOL", ">"); +pub static ATTACH_SYMBOL: EnvVar = ("REMUX_ATTACH_SYMBOL", "*"); +pub static CURRENT_SYMBOL: EnvVar = ("REMUX_CURRENT_SYMBOL", ">"); pub static NEW_WINDOW_NAME: EnvVar = ("REMUX_NEW_WINDOW", ""); +pub static NEW_RC: EnvVar = ("REMUX_NEW_RC", "1"); pub static TMUX: &str = "TMUX";