summarylogtreecommitdiffstats
path: root/fix-argv.diff
blob: 1f302df1a45b71ef3414197aca34fb8fadeb5323 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/apps/studio/src/common/platform_info.ts b/apps/studio/src/common/platform_info.ts
index c69364fa..c406d363 100644
--- a/apps/studio/src/common/platform_info.ts
+++ b/apps/studio/src/common/platform_info.ts
@@ -46,7 +46,15 @@ if (p.env.PORTABLE_EXECUTABLE_DIR) {
 
 const sessionType = p.env.XDG_SESSION_TYPE
 
-const slice = isDevEnv ? 2 : 1
+let slice = 0;
+
+for (const arg of process.argv) {
+  slice++;
+  if (arg.includes('app.asar') === true) {
+    break;
+  }
+}
+
 const parsedArgs = yargs(p.argv.slice(slice))
 // TODO: Automatically enable wayland without flags once
 // we're confident it will 'just work' for all Wayland users.