mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:57:45 +00:00
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:
parent
acd2604a31
commit
609a0aa75d
1 changed files with 7 additions and 0 deletions
|
@ -6,17 +6,24 @@
|
||||||
|
|
||||||
#include "Providers.h"
|
#include "Providers.h"
|
||||||
#include "FuzzyMatch.h"
|
#include "FuzzyMatch.h"
|
||||||
|
#include <LibCore/StandardPaths.h>
|
||||||
#include <LibGUI/Clipboard.h>
|
#include <LibGUI/Clipboard.h>
|
||||||
#include <LibGUI/FileIconProvider.h>
|
#include <LibGUI/FileIconProvider.h>
|
||||||
#include <LibJS/Interpreter.h>
|
#include <LibJS/Interpreter.h>
|
||||||
#include <LibJS/Lexer.h>
|
#include <LibJS/Lexer.h>
|
||||||
#include <LibJS/Parser.h>
|
#include <LibJS/Parser.h>
|
||||||
#include <LibJS/Runtime/GlobalObject.h>
|
#include <LibJS/Runtime/GlobalObject.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
namespace Assistant {
|
namespace Assistant {
|
||||||
|
|
||||||
void AppResult::activate() const
|
void AppResult::activate() const
|
||||||
{
|
{
|
||||||
|
if (chdir(Core::StandardPaths::home_directory().characters()) < 0) {
|
||||||
|
perror("chdir");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
m_app_file->spawn();
|
m_app_file->spawn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue