[Bug] The --debug CLI flag never starts the app
Description
marktext --debug, which --help and docs/end-user/CLI.md advertise as "Enable debug mode", never starts the app. Node's CLI parser inside Electron claims the flag before MarkText sees it and aborts:
electron: [DEP0062]: `node --debug` and `node --debug-brk` are invalid. Please use `node --inspect` and `node --inspect-brk` instead.
The process exits with code 9. --debug=1 fails the same way. Other flags are unaffected — --verbose, --user-data-dir, --safe all start the app normally — and the documented environment variable MARKTEXT_DEBUG=1 works, so debug mode itself is reachable, just not through this flag.
Possible directions (not verified):
- Rename the flag to something Node doesn't claim, keeping
MARKTEXT_DEBUGas it is. - Or drop
--debugfrom--helpand CLI.md and point atMARKTEXT_DEBUG=1. - Or check whether the
enableNodeCliInspectArgumentsElectron fuse makes Node ignore these arguments, which would also harden packaged builds.
Steps to Reproduce
- From a terminal, run a packaged MarkText with the flag, in a throwaway profile so nothing else is touched:
<MarkText>/Contents/MacOS/marktext --user-data-dir /tmp/mt-debug --debug
Expected Behavior
MarkText starts with debug mode on, the same as MARKTEXT_DEBUG=1 marktext.
Actual Behavior
No window appears. The process prints the DEP0062 message above and exits with code 9.
Operating System
macOS
MarkText Version
0.20.0-rc.3 (also reproduced on a develop build)
OS Version
macOS 26 (Darwin 27.0.0)
Source: marktext/marktext