explorer: add copyPathQuoteStyle setting to wrap copied paths with quotes#317956
Open
RajeshKumar11 wants to merge 4 commits into
Open
explorer: add copyPathQuoteStyle setting to wrap copied paths with quotes#317956RajeshKumar11 wants to merge 4 commits into
RajeshKumar11 wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new Explorer setting to control whether copied file paths are wrapped in quotes, and applies it when copying file paths to the clipboard.
Changes:
- Introduced
explorer.copyPathQuoteStyleconfiguration withnone|double|singleoptions. - Updated
resourcesToClipboardto wrap each copied path in the configured quote style.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/vs/workbench/contrib/files/browser/files.contribution.ts | Registers the new explorer.copyPathQuoteStyle setting and its descriptions. |
| src/vs/workbench/contrib/files/browser/fileCommands.ts | Applies the new setting when generating clipboard text for copied resource paths. |
| const quote = quoteStyle === 'double' ? '"' : quoteStyle === 'single' ? "'" : ''; | ||
| const text = resources.map(resource => { | ||
| const label = labelService.getUriLabel(resource, { relative, noPrefix: true, separator }); | ||
| return quote ? `${quote}${label}${quote}` : label; |
|
|
||
| const text = resources.map(resource => labelService.getUriLabel(resource, { relative, noPrefix: true, separator })).join(lineDelimiter); | ||
| const quoteStyle = configurationService.getValue<'none' | 'double' | 'single'>('explorer.copyPathQuoteStyle'); | ||
| const quote = quoteStyle === 'double' ? '"' : quoteStyle === 'single' ? "'" : ''; |
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 #229280
Summary
Adds a new
explorer.copyPathQuoteStylesetting that controls whether copied file paths are wrapped with quotes.Options:
none(default) -- no wrapping, preserves existing behaviordouble-- wraps paths in double quotes, e.g. "C:\My Folder\file.txt"single-- wraps paths in single quotes, e.g. 'C:\My Folder\file.txt'Motivation
When copying paths that contain spaces, the copied value is not directly usable in terminal commands without manual quoting. This setting lets users configure automatic quote wrapping to match their shell preferences.
Files Changed