Strip surrounding quotes from CLI paths for Windows CMD#91
Merged
Conversation
Windows CMD does not strip single quotes from arguments, so `--home 'C:\Users\foo'` passes the literal value `'C:\Users\foo'` (quotes included), producing broken paths like `'C:\...\'\config.toml`. Strip matching surrounding single or double quotes in expandPath(), which handles --home, --config, and MSGVAULT_HOME paths. Co-Authored-By: Claude Opus 4.6 <[email protected]>
On Unix, shells strip quotes before the process sees them, and literal quote characters in paths are valid (if unusual). Guard the stripping with runtime.GOOS == "windows" and mark the corresponding tests as windowsOnly. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Owner
Author
|
I tested this locally and confirmed it resolves the issue when a user uses single quotes to pass the |
wesm
added a commit
to robelkin/msgvault
that referenced
this pull request
Feb 7, 2026
## Summary Fixes wesm#86 - Windows CMD does not strip single quotes from arguments, so `--home 'C:\Users\foo'` passes the literal value `'C:\Users\foo'` (quotes included), producing broken paths like `'C:\Users\foo'\config.toml` - `expandPath()` now strips matching surrounding single or double quotes before processing, covering `--home`, `--config`, and `MSGVAULT_HOME` paths ## Test plan - [x] `TestExpandPath` — new cases for single-quoted, double-quoted, mismatched, and single-char inputs - [x] `make lint` — clean - [x] `make test` — all pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <[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.
Summary
Fixes #86
--home 'C:\Users\foo'passes the literal value'C:\Users\foo'(quotes included), producing broken paths like'C:\Users\foo'\config.tomlexpandPath()now strips matching surrounding single or double quotes before processing, covering--home,--config, andMSGVAULT_HOMEpathsTest plan
TestExpandPath— new cases for single-quoted, double-quoted, mismatched, and single-char inputsmake lint— cleanmake test— all pass🤖 Generated with Claude Code