feat: option to open new windows in the current directory
This commit is contained in:
parent
a301e64503
commit
fe2b6ca484
2 changed files with 16 additions and 7 deletions
|
|
@ -63,8 +63,8 @@ focus-follow-mouse = Typing focus follows mouse
|
|||
advanced = Advanced
|
||||
show-headerbar = Show header
|
||||
show-header-description = Reveal the header from the right-click menu
|
||||
tab-new-inherit-working-directory = New tabs use current directory
|
||||
tab-new-inherit-working-directory-description = Open new tabs in the active tab's working directory
|
||||
tab-new-inherit-working-directory = New tabs and windows use current directory
|
||||
tab-new-inherit-working-directory-description = Open new tabs and windows in the active tab's working directory
|
||||
|
||||
### Keyboard shortcuts
|
||||
add-another-keybinding = Add another keybinding
|
||||
|
|
|
|||
19
src/main.rs
19
src/main.rs
|
|
@ -3299,12 +3299,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