Skip to content

feat: open the active environment folder with raven env open - #69

Merged
MotherSphere merged 3 commits into
Project-Colony:mainfrom
ghahramani:feat/env-open
Dec 1, 2026
Merged

MotherSphere merged 3 commits into
Project-Colony:mainfrom
ghahramani:feat/env-open

Conversation

@ghahramani

Copy link
Copy Markdown
Contributor

Summary

Adds raven env open [name] [--root] [--path] to open the folder of the active or named environment so users can find installed .exe files and create shortcuts with raven env shortcut.

  • Default target (upper/): opens the environment's writable C: layer (~/.local/share/Colony/Raven/environments/<name>/upper/) in the user's file manager via xdg-open (with gio open fallback). Because the merged C: exists only inside a session's private mount namespace, upper/ is visible on the host and contains only files written into that environment without the base Windows tree.
  • Active environment resolution: when [name] is omitted, Environment::active selects the single environment with a live session (session().is_some()), returns an error listing the running environments if more than one is active, and falls back to the configured default environment (raven env default) if none is running.
  • Options: --root opens the environment's root directory instead of upper/, and --path prints the resolved path without launching a file manager.
  • Docs & i18n: adds English/French CLI help, error messages, and output strings, plus updates README.md and docs/guide/usage.md.

Verification

  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --locked (all 254 workspace tests passed)

`raven env open [name] [--root] [--path]` opens the writable `C:` layer (`upper/`) of the active or named environment in the desktop file manager, or prints its path with `--path`.

Because the merged `C:` exists only inside a session's private mount namespace, `upper/` is both visible on the host and free of the base Windows files, making it easy to locate installed `.exe` files for `raven env shortcut`.

When no environment name is given, `Environment::active` picks the single running environment (`session().is_some()`), refuses by name if more than one is running, and falls back to the configured default environment otherwise.
- Without a name, the default environment is taken when it is running,
  the running one when only one is, and the default otherwise. A session
  lasts until `env stop`, so two running ones no longer make every call
  fail; and a default whose manifest is broken reports that, not "no
  environment". The "nothing running" case reuses NoDefaultEnvironment,
  and neither error names `raven env open`, since `env apps` and
  `env uninstall` share them.
- Opening the folder of a running environment prints a warning: overlayfs
  leaves a change to its upper layer while mounted undefined, and Raven
  itself writes there only after `env stop`. The hint gives the C: path a
  file there has, which is what `raven env shortcut` takes.
- An opener that exits with an error is reported, and the next one tried;
  one still running after a second is the file manager, left to run.
  The opener's stderr is kept. The reaper thread and the directory checks
  go: a missing folder is now the opener's error, not "preparing the layer
  failed".
- --root is dropped: the environment's root holds the prefix's .reg files,
  which the session's wineserver rewrites.
- Docs: the section moves after the shortcut text, says what is and is not
  in the folder, and status.md lists the command; 252 tests.
The warning about changing the folder while the environment runs now
checks the processes holding its mount, as `ensure_not_running` does,
instead of the session's anchor alone: a program can outlive the anchor,
and the anchor cannot be found when XDG_RUNTIME_DIR is unset. With --path
the warning goes to stderr, so a script still reads the path alone.

The help and the guide no longer say that nothing of Wine's or the base's
is in the folder: `raven env dxvk`, `vkd3d` and `nvapi` install DLLs into
its windows folder, and so does a Wine update. They also say what happens
when several environments run and none is the default.
@MotherSphere
MotherSphere merged commit 2f71a0c into Project-Colony:main Dec 1, 2026
5 of 6 checks passed
@MotherSphere

Copy link
Copy Markdown
Member

Thanks for this one, and for all the PRs lately. It's merged in 2f71a0c and shipped in v0.8.0, with a few changes on top:

  • Without a name, the default environment wins when it is running, then a single running one, then the default. A session lasts until raven env stop, so having two running used to make every call without a name fail.
  • It warns while anything holds the environment's mount. overlayfs leaves a change to the upper layer of a mounted overlay undefined, and Raven itself only writes there after env stop.
  • An opener that exits with an error is reported, instead of printing "Opened".
  • --root went: the root also holds the prefix's .reg files, which the session's wineserver rewrites.

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.

2 participants