Skip to content

Open folders passed as launch arguments - #1844

Open
rthw wants to merge 2 commits into
CyberTimon:mainfrom
rthw:pr/open-folder-arg
Open

rthw wants to merge 2 commits into
CyberTimon:mainfrom
rthw:pr/open-folder-arg

Conversation

@rthw

@rthw rthw commented Oct 4, 2026

Copy link
Copy Markdown

Open folders passed as launch arguments

Fixes #1176.

RapidRAW previously treated every positional launch argument and macOS open -a RapidRAW <path> request as an image file. Passing a folder therefore opened it in the external editor flow and failed with “Is a directory”.

This change distinguishes directories from files in the launch request path. A folder is added to the library roots when necessary and selected in the library. If it is already inside an existing root, it is selected without creating a duplicate root.

Folder paths are canonicalized (symlinks and trailing separators included), so the same folder is never added twice, and on a cold start the library roots are seeded from the settings before the folder is used — opening a folder no longer replaces the user's existing roots.

How to test

  1. Build RapidRAW on macOS.
  2. Run open -a RapidRAW /path/to/photo-folder while RapidRAW is closed. The app should open the folder in the library grid.
  3. While the app is running, run open -a RapidRAW /path/to/another-folder. The window should come forward and switch to that folder.
  4. Run the app binary directly with a folder argument:
    RapidRAW.app/Contents/MacOS/RapidRAW /path/to/photo-folder
  5. Repeat step 2 with a folder nested under an existing root. It must not add a second root.
  6. Launch with a folder while other library roots are configured: the existing roots must survive.

Not changed

  • File arguments still use the existing external image-open flow.
  • --edit / --output external edit sessions are unchanged.
  • Headless export and normal launches without arguments are unchanged.

rthw added 2 commits October 4, 2026 14:43
- normalize trailing separators and canonicalize the launch path, so a folder
  nested in an existing root is selected instead of added as a second root
- seed the library roots from settings on a cold start, so opening a folder
  no longer replaces the existing library roots
@rthw
rthw requested a review from CyberTimon as a code owner October 4, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant