Assistant: Change to home directory when spawning applications

When launching Terminal via Taskbar we change to the users home
directory. For consistency, let's also `chdir` to `/home/anon` when
launching apps via Assistant's AppProvider.
This commit is contained in:
Spencer Dixon 2021-07-01 16:41:52 -04:00 committed by Andreas Kling
parent acd2604a31
commit 609a0aa75d
Notes: sideshowbarker 2024-07-18 11:07:53 +09:00

View File

@ -6,17 +6,24 @@
#include "Providers.h"
#include "FuzzyMatch.h"
#include <LibCore/StandardPaths.h>
#include <LibGUI/Clipboard.h>
#include <LibGUI/FileIconProvider.h>
#include <LibJS/Interpreter.h>
#include <LibJS/Lexer.h>
#include <LibJS/Parser.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <unistd.h>
namespace Assistant {
void AppResult::activate() const
{
if (chdir(Core::StandardPaths::home_directory().characters()) < 0) {
perror("chdir");
exit(1);
}
m_app_file->spawn();
}