Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions i18n/en/cosmic_term.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 14 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3225,12 +3225,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);
}
Expand Down
Loading