fix(desktop): open file passed as CLI argument on launch#48
Merged
ThisIs-Developer merged 1 commit intoThisIs-Developer:mainfrom Mar 20, 2026
Merged
Conversation
When a .md file is set to open with the desktop app (e.g. via OS file association), the file path is passed as a command-line argument. Previously the app ignored it and always showed the landing page, requiring the user to drag-and-drop or import the file manually. This change reads the argument in main.js using Neutralino.filesystem .readFile and injects the content into the editor on startup. filesystem.readFile is also added to nativeAllowList in neutralino.config.json to permit the API call.
|
Someone is attempting to deploy a commit to the ThisIs-Developer Team on Vercel. A member of the Team first needs to authorize it. |
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.
Problem
When a .md file is associated with the desktop app and double-clicked, the OS passes the file path as a command-line argument. The app was ignoring this and always showed the landing page, forcing the user to manually drag-and-drop or import the file.
Solution
In main.js, added a loadInitialFile function that reads NL_ARGS to find any .md or .markdown file path, uses Neutralino.filesystem.readFile to load its content, then injects it into the editor on startup.
In neutralino.config.json, added filesystem.readFile to nativeAllowList to permit the API call.
Testing