feat: option to open new windows in the current directory

This commit is contained in:
Hojjat 2026-05-25 11:16:10 -06:00 committed by Ashley Wulber
parent fa611ea07d
commit 91fd140ae3
2 changed files with 16 additions and 7 deletions

View file

@ -3227,12 +3227,21 @@ impl Application for App {
}
}
Message::WindowNew => match env::current_exe() {
Ok(exe) => match process::Command::new(&exe).spawn() {
Ok(_child) => {}
Err(err) => {
log::error!("failed to execute {:?}: {}", exe, err);
Ok(exe) => {
let mut command = process::Command::new(&exe);
if self.config.tab_new_inherit_working_directory
&& let Some(dir) = self.active_terminal_working_directory()
{
command.arg("--working-directory");
command.arg(dir);
}
},
match command.spawn() {
Ok(_child) => {}
Err(err) => {
log::error!("failed to execute {:?}: {}", exe, err);
}
}
}
Err(err) => {
log::error!("failed to get current executable path: {}", err);
}