mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
Fix Host::Launch to work in Flatpak sandboxed environment. (#252)
This commit is contained in:
parent
59bd635ec3
commit
d08975a53d
1 changed files with 21 additions and 9 deletions
|
|
@ -272,17 +272,29 @@ void Host::Launch(const char *_cmdline, bool console)
|
|||
if(console)
|
||||
cmdline = "/usr/bin/open " + script;
|
||||
#else
|
||||
String lc = ResolveHostConsole();
|
||||
if(FileExists(lc))
|
||||
{
|
||||
if(console)
|
||||
cmdline = HostConsole + " sh " + script;
|
||||
if(console) {
|
||||
String lc = ResolveHostConsole();
|
||||
if(FileExists(lc))
|
||||
{
|
||||
#ifdef FLATPAK
|
||||
auto real_hc = HostConsole;
|
||||
real_hc.Replace(String("/run/host/"), String("/usr/"));
|
||||
cmdline = FindCommand(exedirs, CMDLINE_PREFIX + real_hc + " sh " + script);
|
||||
#else
|
||||
cmdline = HostConsole + " sh " + script;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
if(HostConsole.GetCount())
|
||||
PutConsole("Warning: Terminal '" + lc + "' not found, executing in background.");
|
||||
}
|
||||
#ifdef FLATPAK
|
||||
else {
|
||||
cmdline = FindCommand(exedirs, CMDLINE_PREFIX + cmdline);
|
||||
}
|
||||
else
|
||||
if(HostConsole.GetCount())
|
||||
PutConsole("Warning: Terminal '" + lc + "' not found, executing in background.");
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Buffer<char> cmd_buf(strlen(cmdline) + 1);
|
||||
Vector<char *> args;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue