summarylogtreecommitdiffstats
path: root/fix-argv.diff
blob: 97261016f6301c8e45c69c6977df6d7dd647843d (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 9665932f..e37dd4e4 100644
--- a/apps/studio/src/common/platform_info.ts
+++ b/apps/studio/src/common/platform_info.ts
@@ -51,7 +51,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.