summaryrefslogtreecommitdiff
path: root/Applications/Terminal/main.cpp
diff options
context:
space:
mode:
authorShannon Booth <shannon.ml.booth@gmail.com>2020-05-02 21:28:26 +1200
committerAndreas Kling <kling@serenityos.org>2020-05-02 14:12:57 +0200
commit0e403a43a474923f233d522da3f272588203e9af (patch)
treeadb81abe764c6750d683ea97062c325e192a7ec9 /Applications/Terminal/main.cpp
parent548ecceb752101cb2d1049894fa087303fd4e9ff (diff)
downloadserenity-0e403a43a474923f233d522da3f272588203e9af.zip
Terminal: Add config for startup command
This is useful when working on a program as you can put the command into the config file, instead of having to type it up each time on boot.
Diffstat (limited to 'Applications/Terminal/main.cpp')
-rw-r--r--Applications/Terminal/main.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Applications/Terminal/main.cpp b/Applications/Terminal/main.cpp
index cfdb9d68f5..eb3b290a86 100644
--- a/Applications/Terminal/main.cpp
+++ b/Applications/Terminal/main.cpp
@@ -216,14 +216,18 @@ int main(int argc, char** argv)
return 1;
}
- run_command(ptm_fd, command_to_execute);
+ RefPtr<Core::ConfigFile> config = Core::ConfigFile::get_for_app("Terminal");
+
+ if (command_to_execute)
+ run_command(ptm_fd, command_to_execute);
+ else
+ run_command(ptm_fd, config->read_entry("Startup", "Command"));
auto window = GUI::Window::construct();
window->set_title("Terminal");
window->set_background_color(Color::Black);
window->set_double_buffering_enabled(false);
- RefPtr<Core::ConfigFile> config = Core::ConfigFile::get_for_app("Terminal");
auto& terminal = window->set_main_widget<TerminalWidget>(ptm_fd, true, config);
terminal.on_command_exit = [&] {
app.quit(0);