Repository navigation
feat: open the active environment folder with raven env open - #69
Merged
Merged
Conversation
`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.
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:
|
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.
Summary
Adds
raven env open [name] [--root] [--path]to open the folder of the active or named environment so users can find installed.exefiles and create shortcuts withraven env shortcut.upper/): opens the environment's writableC:layer (~/.local/share/Colony/Raven/environments/<name>/upper/) in the user's file manager viaxdg-open(withgio openfallback). Because the mergedC: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.[name]is omitted,Environment::activeselects 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.--rootopens the environment's root directory instead ofupper/, and--pathprints the resolved path without launching a file manager.README.mdanddocs/guide/usage.md.Verification
cargo fmt --all -- --checkcargo clippy --all-targets -- -D warningscargo test --locked(all 254 workspace tests passed)