From 21eda336241985f10f18d664ed70f9340d551100 Mon Sep 17 00:00:00 2001 From: Valerie Date: Mon, 10 Jun 2024 12:02:57 -0400 Subject: [PATCH] default window name now sets correctly --- src/command/share.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/command/share.rs b/src/command/share.rs index a89fa5f..9d1d927 100644 --- a/src/command/share.rs +++ b/src/command/share.rs @@ -178,10 +178,16 @@ 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) - .output().ok(); + let mut tmux = Tmux::new().add_command(new); + + // rename window if var not empty + if !window_name.is_empty() { + let auto_name = commands::RenameWindow::new() + .new_name(window_name); + tmux = tmux.add_command(auto_name); + } + + tmux.output().ok(); }