feat: option to open new windows in the current directory
This commit is contained in:
parent
fa611ea07d
commit
91fd140ae3
2 changed files with 16 additions and 7 deletions
19
src/main.rs
19
src/main.rs
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue