mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:37:36 +00:00
Terminal: Remove working directory argument
Applications that want to spawn Terminal in a specific directory should chdir to it before execing it.
This commit is contained in:
parent
c18f12bb96
commit
d98fbd192e
1 changed files with 0 additions and 11 deletions
|
@ -197,23 +197,12 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* command_to_execute = nullptr;
|
const char* command_to_execute = nullptr;
|
||||||
const char* working_directory_chars = nullptr;
|
|
||||||
|
|
||||||
Core::ArgsParser args_parser;
|
Core::ArgsParser args_parser;
|
||||||
args_parser.add_option(command_to_execute, "Execute this command inside the terminal", nullptr, 'e', "command");
|
args_parser.add_option(command_to_execute, "Execute this command inside the terminal", nullptr, 'e', "command");
|
||||||
args_parser.add_option(working_directory_chars, "Set the working directory", nullptr, 'd', "directory");
|
|
||||||
|
|
||||||
args_parser.parse(argc, argv);
|
args_parser.parse(argc, argv);
|
||||||
|
|
||||||
String working_directory(working_directory_chars);
|
|
||||||
|
|
||||||
if (working_directory.is_empty()) {
|
|
||||||
working_directory = get_current_user_home_path();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (chdir(working_directory.characters()) < 0)
|
|
||||||
perror("chdir");
|
|
||||||
|
|
||||||
int ptm_fd = posix_openpt(O_RDWR | O_CLOEXEC);
|
int ptm_fd = posix_openpt(O_RDWR | O_CLOEXEC);
|
||||||
if (ptm_fd < 0) {
|
if (ptm_fd < 0) {
|
||||||
perror("posix_openpt");
|
perror("posix_openpt");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue