Compare commits

..

No commits in common. "087a2fe66e68a5cef009424dbfaa3fa009caceb4" and "fd076f7feee84f33936b502f93d54debf78d7c90" have entirely different histories.

3 changed files with 3 additions and 13 deletions

View file

@ -149,13 +149,10 @@ pub fn new(pargs: &mut Arguments) {
// don't allow unflagged nesting
util::prevent_nest();
// get optional flags
// get optional flag
let detached = pargs.contains(flag::DETACH);
let target_dir: Result<String, Error> = pargs.value_from_str(flag::TARGET);
// get environment variables
let window_name = env_var(env::NEW_WINDOW_NAME);
// get target or fallback
let args = pargs.clone().finish();
let title: String;
@ -174,7 +171,6 @@ pub fn new(pargs: &mut Arguments) {
if let Some(command) = command { new.shell_command = Some(command.to_string_lossy()); }
if detached { new.detached = true; }
if let Ok(target_dir) = target_dir { new = new.start_directory(target_dir); }
if !window_name.is_empty() { new.window_name = Some(window_name.into()); }
Tmux::new()
.add_command(new)

View file

@ -2,8 +2,7 @@ use std::env::var;
pub type EnvVar = (&'static str, &'static str);
pub static ATTACH_SYMBOL: EnvVar = ("REMUX_ATTACH_SYMBOL", "*");
pub static NEW_WINDOW_NAME: EnvVar = ("REMUX_NEW_WINDOW", "");
pub static ATTACH_SYMBOL: EnvVar = ("REMUX_ATTACH_SYMBOL", "*");
pub fn env_var(envvar: EnvVar) -> String {
var(envvar.0).unwrap_or(envvar.1.to_string())

View file

@ -107,12 +107,7 @@ println!("remux environment variables
REMUX_ATTACH_SYMBOL
Changes the symbol displayed for attached sessions displayed
by the 'list' command.
Default: '*'
REMUX_NEW_WINDOW
Provides a default window name when creating a session with
the 'new' command, if not empty.
Default: ''"),
Default: '*'"),
// not found
_ => error::no_help(topic.unwrap())