Repository navigation
fix(desktop): let the --debug flag reach MarkText in packaged builds - #5643
Merged
Merged
Conversation
Member
|
The testing is somewhat redundant. BTW, did you actually package and test it on a real machine? |
Electron passes its command line to Node, whose CLI parser treats `--debug` as the removed inspector flag (DEP0062) and exits with code 9 before MarkText reads its arguments. Turn off the nodeCliInspect fuse in electron-builder.yml so packaged builds skip Node's inspector flags and `--debug` reaches the app. Packaged builds also stop honouring `--inspect`; MARKTEXT_DEBUG and development runs are unchanged. Fixes #5409
xThreeh
force-pushed
the
fix/cli-debug-flag
branch
from
October 7, 2026 20:59
e55c117 to
40b247f
Compare
Contributor
Author
|
Yes. I tested it on Windows 11 with the official 0.20.0 win-x64 release:
Agreed on the test, I dropped |
Jocs
approved these changes
Oct 8, 2026
Member
|
Thanks. |
3 of 6 tasks
csells
added a commit
to csells/MarkText
that referenced
this pull request
Oct 13, 2026
Upstream marktext#5643 ships with EnableNodeCliInspectArguments off so packaged `--debug` reaches MarkText, and Playwright's Electron launcher, which attaches through `--inspect`, can no longer start the artifact. Global setup copies MARKTEXT_PACKAGED_APP's app into test-results, turns only that fuse on, re-signs the copy ad hoc, checks its app.asar is the artifact's, and hands the copy to the suite. A new spec launches the artifact itself, fuse off, over --remote-debugging-port and checks the editor renders with the expected build commit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5409
Summary
Electron hands its command line to Node, and Node's CLI parser rejects
--debugas the removed inspector flag (DEP0062), exiting with code 9 before MarkText reads its arguments. This turns off thenodeCliInspectfuse inelectron-builder.yml, so packaged builds skip Node's inspector flags and--debugreaches the app.Side effect worth knowing: packaged builds no longer honour
--inspect/--inspect-brkeither (Electron's security checklist recommends this fuse off).MARKTEXT_DEBUG=1andpnpm run devare unchanged; dev runs still use the unfused Electron, soissue-5407-debug-mode.spec.tskeeps usingMARKTEXT_DEBUG.Type of change
Test plan
electron-builder --linux dirfromdevelopand from this branch and read the renderer'sdebugflag through--remote-debugging-port:develop:--debugexits with code 9 (DEP0062).--debugstarts withdebug=1; no flag and--inspectstart withdebug=0.marktext.exe --debug --helpexits 9 (DEP0062) unmodified and prints MarkText's usage with the fuse off.By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.