summaryrefslogtreecommitdiff
path: root/Applications/Terminal
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2020-03-16 22:31:35 +0200
committerAndreas Kling <kling@serenityos.org>2020-03-18 08:23:31 +0100
commitd98fbd192e56346a97892348f0451f9d30ce6815 (patch)
treef9c081d859dda6a9e04ccf0bff190040da24a531 /Applications/Terminal
parentc18f12bb96a3145efff68e12c682cdae57527ea9 (diff)
downloadserenity-d98fbd192e56346a97892348f0451f9d30ce6815.zip
Terminal: Remove working directory argument
Applications that want to spawn Terminal in a specific directory should chdir to it before execing it.
Diffstat (limited to 'Applications/Terminal')
-rw-r--r--Applications/Terminal/main.cpp11
1 files changed, 0 insertions, 11 deletions
diff --git a/Applications/Terminal/main.cpp b/Applications/Terminal/main.cpp
index 324f965dc4..162836affe 100644
--- a/Applications/Terminal/main.cpp
+++ b/Applications/Terminal/main.cpp
@@ -197,23 +197,12 @@ int main(int argc, char** argv)
}
const char* command_to_execute = nullptr;
- const char* working_directory_chars = nullptr;
Core::ArgsParser args_parser;
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);
- 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);
if (ptm_fd < 0) {
perror("posix_openpt");