From 58ff8fde2a7d42d6dbad47ab7abc3cdc54a96671 Mon Sep 17 00:00:00 2001 From: Valerie Date: Thu, 14 Mar 2024 16:51:40 -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 8d04e43..a98fd7d 100644 --- a/src/command/share.rs +++ b/src/command/share.rs @@ -174,10 +174,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(); }