Windows: cross-platform home_dir lookup (#8, #13)#16
Merged
MasonStation merged 1 commit intomainfrom Apr 22, 2026
Merged
Conversation
Replaces direct reads of \$HOME (unset by default on Windows) with dirs::home_dir(), which resolves to: - \$HOME on Unix - %USERPROFILE% on Windows Vault fallback path preserves existing ~/.phantom location on every OS; no migration needed for existing Mac/Linux users. /tmp fallback replaced with std::env::temp_dir() which resolves to %TEMP% on Windows. Closes #8 Closes #13 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.
Second slice of #1 (Windows support) — Tier 1 (home dir).
Summary
Replaces direct reads of
\$HOMEwithdirs::home_dir(), which resolves to\$HOMEon Unix and%USERPROFILE%on Windows.crates/phantom-vault/src/lib.rs:71-74) — keeps the existing~/.phantomvault location on all OSes (behavior-preserving for existing Mac/Linux users; correct on Windows)./tmpfallback replaced withstd::env::temp_dir()which resolves to%TEMP%on Windows.crates/phantom-cli/src/commands/setup.rs:176-178) — used to locate~/.cargo/bin/phantom-mcp.Why no vault migration concern
The
dirs_fallback()path is already$HOME/.phantomon Unix.dirs::home_dir()returns the same$HOMEvalue on Unix. Existing vaults keep the same location.Test plan
ubuntu-latestmacos-latestwindows-latestCloses #8
Closes #13