Startup in the home directory when launched by launch services

This commit is contained in:
Kovid Goyal
2017-02-02 15:07:13 +05:30
parent af1f3cc7c7
commit 3911f18fd9
2 changed files with 3 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ static int run_embedded(const char* exe_dir_, int argc, wchar_t **argv) {
if (num < 0 || num >= PATH_MAX) { fprintf(stderr, "Failed to create path to kitty lib\n"); return 1; }
Py_Initialize();
PySys_SetArgvEx(argc - 1, argv + 1, 0);
PySys_SetObject("frozen", Py_True); // dont care if this fails
PyObject *kitty = PyUnicode_FromWideChar(stdlib, -1);
if (kitty == NULL) { fprintf(stderr, "Failed to allocate python kitty lib object\n"); goto end; }
PyObject *runpy = PyImport_ImportModule("runpy");