Repository navigation
Strip the quotes from a path pasted at the prompt [patch] - #199
Merged
Merged
Conversation
Explorer's Copy as path, and dragging a folder with a space into a terminal, wrap the path in quotes. The prompt only trimmed its input, so the quotes stayed in and Path.GetFullPath resolved the quoted text under the current directory, reporting "Directory not found". The four copies of the prompt in Scan, DryRun, Deduplicate and Stats move into BaseVerb.PromptForPathIfMissing, which removes one matching pair of surrounding " or ' before using the answer. Fixes #152 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW2CxWzSsPmDZkw2R6J
|
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.



Fixes #152
What was wrong
Explorer's Copy as path, and dragging a folder with a space into a terminal, both wrap the path in quotes. The path prompt only called
.Trim(), so the quotes stayed in the string, andPath.GetFullPathresolved the quoted text as a relative name under the current directory. The result wasScanning: /cwd/"/some dir"followed byDirectory not found.Change
Scan,DryRun,DeduplicateandStatsmove into one helper,BaseVerb.PromptForPathIfMissing(action). Each verb'sValidateArgsnow calls it."or'(BaseVerb.Unquote) before it uses the answer. A quoted empty answer ("") aborts the same way an empty one does.Tests
QuotedPathPromptTestsdrives the prompt through stdin using the existingConsoleCapturehelper:"dir",'dir'and a padded"dir"scans the directory and finds the duplicate group.Unquotecases cover"C:\some dir",'/some dir', a mismatched pair, a lone", and doubled quotes.""aborts with exit code 1.With the
Unquotecall reverted, 5 of these tests fail. With it in place the full suite passes: 133 total, 130 passed, 3 skipped. The 3 skips are permission tests that are inconclusive when run as root.Generated by Claude Code