mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
FileManager: chdir to appropriate directory before starting Terminal
This commit is contained in:
parent
bd9f14e27e
commit
a4497ce375
Notes:
sideshowbarker
2024-07-19 08:16:02 +09:00
Author: https://github.com/itamar8910 Commit: https://github.com/SerenityOS/serenity/commit/a4497ce375f Pull-request: https://github.com/SerenityOS/serenity/pull/1477 Reviewed-by: https://github.com/bugaevc
1 changed files with 6 additions and 2 deletions
|
@ -189,8 +189,12 @@ int main(int argc, char** argv)
|
|||
|
||||
auto open_terminal_action = GUI::Action::create("Open Terminal here...", Gfx::Bitmap::load_from_file("/res/icons/16x16/app-terminal.png"), [&](const GUI::Action&) {
|
||||
if (!fork()) {
|
||||
int rc = execl("/bin/Terminal", "Terminal", "-d", directory_view.path().characters(), nullptr);
|
||||
if (rc < 0)
|
||||
if (chdir(directory_view.path().characters()) < 0) {
|
||||
perror("chdir");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (execl("/bin/Terminal", "Terminal", nullptr) < 0)
|
||||
perror("execl");
|
||||
exit(1);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue