diff --git a/src/openrct2-ui/UiContext.Linux.cpp b/src/openrct2-ui/UiContext.Linux.cpp index dc5aea4315..4ea06f0b0f 100644 --- a/src/openrct2-ui/UiContext.Linux.cpp +++ b/src/openrct2-ui/UiContext.Linux.cpp @@ -133,6 +133,7 @@ namespace OpenRCT2::Ui { std::string result; std::string executablePath; + u8string directory = EscapePathForShell(desc.InitialDirectory + '/'); DIALOG_TYPE dtype = GetDialogApp(&executablePath); switch (dtype) { @@ -141,8 +142,8 @@ namespace OpenRCT2::Ui std::string action = (desc.Type == FileDialogType::Open) ? "--getopenfilename" : "--getsavefilename"; std::string filter = GetKDialogFilterString(desc.Filters); std::string cmd = String::StdFormat( - "%s --title '%s' %s '%s' '%s'", executablePath.c_str(), desc.Title.c_str(), action.c_str(), - desc.InitialDirectory.c_str(), filter.c_str()); + "%s --title '%s' %s %s '%s'", executablePath.c_str(), desc.Title.c_str(), action.c_str(), + directory.c_str(), filter.c_str()); std::string output; if (Platform::Execute(cmd, &output) == 0) { @@ -160,8 +161,8 @@ namespace OpenRCT2::Ui } std::string filters = GetZenityFilterString(desc.Filters); std::string cmd = String::StdFormat( - "%s %s --filename='%s/' %s --title='%s' / %s", executablePath.c_str(), action.c_str(), - desc.InitialDirectory.c_str(), flags.c_str(), desc.Title.c_str(), filters.c_str()); + "%s %s --filename=%s %s --title='%s' / %s", executablePath.c_str(), action.c_str(), directory.c_str(), + flags.c_str(), desc.Title.c_str(), filters.c_str()); std::string output; if (Platform::Execute(cmd, &output) == 0) {