1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:08:12 +00:00

FileManager: Use GUI::Process::spawn_or_show_error() to open terminals

This commit is contained in:
MacDue 2023-03-13 20:29:33 +00:00 committed by Linus Groh
parent d27a513dc5
commit 2aa8c9950e
3 changed files with 8 additions and 19 deletions

View file

@ -491,13 +491,13 @@ ErrorOr<int> run_in_desktop_mode()
auto open_terminal_action = GUI::Action::create("Open in &Terminal", {}, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-terminal.png"sv)), [&](auto&) {
auto paths = directory_view->selected_file_paths();
if (paths.is_empty()) {
spawn_terminal(directory_view->path());
spawn_terminal(window, directory_view->path());
return;
}
for (auto& path : paths) {
if (FileSystem::is_directory(path)) {
spawn_terminal(path);
spawn_terminal(window, path);
}
}
});
@ -841,7 +841,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
for (auto& path : paths) {
if (FileSystem::is_directory(path)) {
spawn_terminal(path);
spawn_terminal(window, path);
}
}
},