mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 06:07:34 +00:00
FileManager: chdir to appropriate directory before starting Terminal
This commit is contained in:
parent
bd9f14e27e
commit
a4497ce375
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&) {
|
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()) {
|
if (!fork()) {
|
||||||
int rc = execl("/bin/Terminal", "Terminal", "-d", directory_view.path().characters(), nullptr);
|
if (chdir(directory_view.path().characters()) < 0) {
|
||||||
if (rc < 0)
|
perror("chdir");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (execl("/bin/Terminal", "Terminal", nullptr) < 0)
|
||||||
perror("execl");
|
perror("execl");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue