Skip to content

[Bug] The --debug CLI flag never starts the app #5409

Closed

Description

@Jocs

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_DEBUG as it is.
  • Or drop --debug from --help and CLI.md and point at MARKTEXT_DEBUG=1.
  • Or check whether the enableNodeCliInspectArguments Electron fuse makes Node ignore these arguments, which would also harden packaged builds.

Steps to Reproduce

  1. 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)

Activity

  1. added
    🐛 bug
    on Sep 16, 2026
  2. added a commit that references this issue on Oct 8, 2026
    7623c62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions