From a738b5cb699d506331b082e0b68de14898f23056 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 7 Mar 2019 17:15:59 +0100 Subject: [PATCH] TextEditor: Open an empty document by default. --- Applications/TextEditor/main.cpp | 5 +++-- Kernel/init.cpp | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Applications/TextEditor/main.cpp b/Applications/TextEditor/main.cpp index 1fd5e3e3b86..c1939ba7f8e 100644 --- a/Applications/TextEditor/main.cpp +++ b/Applications/TextEditor/main.cpp @@ -29,8 +29,9 @@ int main(int argc, char** argv) statusbar->set_text(String::format("Line: %d, Column: %d", editor.cursor().line(), editor.cursor().column())); }; - String path = argc < 2 ? "/home/anon/ReadMe.md" : argv[1]; - { + String path = "/tmp/TextEditor.save.txt"; + if (argc >= 2) { + path = argv[1]; StringBuilder builder; int fd = open(path.characters(), O_RDONLY); if (fd < 0) { diff --git a/Kernel/init.cpp b/Kernel/init.cpp index b0d38a9c47a..f55caa81b87 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -104,7 +104,10 @@ VFS* vfs; Process::create_user_process("/bin/ProcessManager", (uid_t)100, (gid_t)100, (pid_t)0, error, { }, { }, tty0); #endif #ifdef SPAWN_TEXT_EDITOR - Process::create_user_process("/bin/TextEditor", (uid_t)100, (gid_t)100, (pid_t)0, error, { }, { }, tty0); + Vector text_editor_arguments; + text_editor_arguments.append("/bin/TextEditor"); + text_editor_arguments.append("/home/anon/ReadMe.md"); + Process::create_user_process("/bin/TextEditor", (uid_t)100, (gid_t)100, (pid_t)0, error, move(text_editor_arguments), { }, tty0); #endif #ifdef SPAWN_FONTEDITOR Process::create_user_process("/bin/FontEditor", (uid_t)100, (gid_t)100, (pid_t)0, error, { }, move(environment), tty0);