Commit e793c89
authored
🤖 fix: support Electron flags (--no-sandbox) in packaged AppImage (#1183)
## Summary
Fix `./mux.AppImage --no-sandbox` and other Electron flags not working -
they were incorrectly falling through to CLI help instead of launching
the desktop app.
## Problem
After the previous CLI argv fix (#1161), Electron flags like
`--no-sandbox` in packaged AppImage were treated as unknown CLI
arguments:
```
./mux.AppImage --no-sandbox # showed CLI help instead of launching desktop
```
## Root Cause
`isElectronLaunchArg()` immediately returned `false` for all packaged
Electron flags, not distinguishing between:
- **CLI flags** (`--help`, `--version`) → should show CLI help
- **Electron flags** (`--no-sandbox`, `--disable-gpu`) → should launch
desktop
## Solution
- Add `CLI_GLOBAL_FLAGS` constant listing flags that should show CLI
help
- Update `isElectronLaunchArg()` to return `true` for non-CLI flags in
packaged mode
- Add runtime sanity check (dev mode only) to warn if flags get out of
sync
- Add tests for the new behavior
## Manual Test Results
| Command | Result |
|---------|--------|
| `./mux.AppImage --no-sandbox` | ✅ Launches desktop |
| `./mux.AppImage --disable-gpu` | ✅ Launches desktop |
| `./mux.AppImage --help` | ✅ Shows CLI help |
| `./mux.AppImage --version` | ✅ Shows version |
| `./mux.AppImage server --help` | ✅ Shows server options |
| `bunx electron . --no-sandbox` | ✅ Launches desktop (dev mode) |
---
_Generated with `mux` • Model: `anthropic:claude-sonnet-4-20250514` •
Thinking: `low`_1 parent e389455 commit e793c89
3 files changed
+71
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
11 | 25 | | |
12 | 26 | | |
13 | 27 | | |
| |||
123 | 137 | | |
124 | 138 | | |
125 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
126 | 148 | | |
127 | 149 | | |
128 | | - | |
| 150 | + | |
129 | 151 | | |
130 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
131 | 160 | | |
132 | 161 | | |
133 | 162 | | |
| |||
154 | 183 | | |
155 | 184 | | |
156 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
157 | 191 | | |
158 | 192 | | |
159 | 193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
73 | 82 | | |
74 | 83 | | |
75 | | - | |
76 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
77 | 87 | | |
78 | 88 | | |
79 | 89 | | |
80 | 90 | | |
81 | 91 | | |
82 | | - | |
83 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
84 | 100 | | |
85 | | - | |
86 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
87 | 104 | | |
88 | 105 | | |
89 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| 83 | + | |
| 84 | + | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
87 | 100 | | |
88 | 101 | | |
89 | 102 | | |
| |||
0 commit comments