Skip to content

Commit

Permalink
Workaround for Electron sanbox issues on Ubuntu (#11038)
Browse files Browse the repository at this point in the history
* Workaround for Electron sanbox issues on Ubuntu

Disabling sanbox, while a non-secure option, appears to be currently the
only option to workaround Electron issues on latest Ubuntu (24.04).
When passed to Enso it is treated as a regular argument, preventing the
start of the product.
This change treats `--no-sandbox` specially by ignoring all arguments
that precede it (and including itself).

* address review
  • Loading branch information
hubertp authored Sep 13, 2024
1 parent 066d4ea commit 8fab4f5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/ide-desktop/client/src/fileAssociations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,15 @@ function getClientArguments(args = process.argv): readonly string[] {
return args.slice(separatorIndex + 1)
}
} else {
// Drop the leading executable name.
return args.slice(1)
const noSandbox = args.indexOf('--no-sandbox')
if (noSandbox !== NOT_FOUND) {
let v = [...args]
v.splice(noSandbox, 1)
return v.slice(1)
} else {
// Drop the leading executable name.
return args.slice(1)
}
}
}

Expand Down

0 comments on commit 8fab4f5

Please sign in to comment.