Skip to content

Commit

Permalink
Fix regression and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Wootten committed Jan 10, 2024
1 parent 3718ce7 commit e65faf8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public class Terminal.Application : Gtk.Application {
bool new_tab, minimized;

options.lookup ("new-tab", "b", out new_tab);
options.lookup ("working-directory", "^&ay", out wd);
var wd_option_present = options.lookup ("working-directory", "^&ay", out wd);

if (options.lookup ("execute", "^a&ay", out commands)) {
for (var i = 0; commands[i] != null; i++) {
Expand All @@ -264,8 +264,10 @@ public class Terminal.Application : Gtk.Application {
command,
new_tab
);
} else {
} else if (wd_option_present) {
window.add_tab_with_working_directory (wd != null ? wd : command_line.get_cwd (), null, new_tab);
} else if (new_tab) {
window.add_tab_with_working_directory (Environment.get_current_dir (), null, new_tab);
}

if (options.lookup ("minimized", "b", out minimized) && minimized) {
Expand Down
2 changes: 1 addition & 1 deletion src/tests/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ namespace Terminal.Test.Application {
unowned var window = (MainWindow) application.active_window;
assert_nonnull (window);
var terminal_directory = window.current_terminal.get_shell_location ();
assert_cmpstr (terminal_directory, CompareOperator.EQ, working_directory);
assert_cmpstr (terminal_directory, CompareOperator.EQ, Environment.get_current_dir ());
});
});

Expand Down

0 comments on commit e65faf8

Please sign in to comment.