summarylogtreecommitdiffstats
path: root/fix-argv.diff
blob: ea78da581ebe13a2ac471c9942720b675e98bf8a (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 4f7471d6..ca2ff97f 100644
--- a/apps/studio/src/common/platform_info.ts
+++ b/apps/studio/src/common/platform_info.ts
@@ -50,7 +50,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.