Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Quote bare quote file paths if the path includes a double quote character#25631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
iSazonov merged 5 commits intoPowerShell:masterfromMartinGC94:fixfilequote
Jun 9, 2025

Conversation

@MartinGC94
Copy link
Contributor

PR Summary

Fixes the logic for the file path completion so paths with double quote characters get single quotes added just like we do for other problematic characters in bare quote strings.

PR Context

Fixes#25629

PR Checklist

mklement0 and kasini3000 reacted with thumbs up emoji
@iSazonoviSazonov added the CL-GeneralIndicates that a PR should be marked as a general cmdlet change in the Change Log labelJun 4, 2025
_=sb.Append('\'');
quotesAreNeeded=true;
// Bareword or singlequoted input string.
if(path[index].IsSingleQuote())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It seems the method would be more readable if we ridded ofuseSingleQuoteEscapeRules and replace it withstringType is StringConstantType.SingleQuoted or StringConstantType.BareWord.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

That check will change when my PR to keep variables when tab completing paths is merged. If someone is tab completing a bareword string with a variable it needs to use double quote rules.

$null=New-Item-Path$TestFile1-Force
$Expected="'$($TestFile1.Insert($TestFile1.LastIndexOf($BadQuote),"'"))'"

$res= TabExpansion2-inputScript"Get-ChildItem -Path '$TestDrive\"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If it is intentional to have single quote it is not obvious so please add a comment.

MartinGC94 reacted with thumbs up emoji
@iSazonoviSazonov self-assigned thisJun 9, 2025
@iSazonov
Copy link
Collaborator

/azp run PowerShell-Windows-Packaging-CI,PowerShell-CI-linux-packaging

@azure-pipelines
Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@iSazonoviSazonov merged commit0380034 intoPowerShell:masterJun 9, 2025
36 checks passed
@microsoft-github-policy-service
Copy link
Contributor

microsoft-github-policy-servicebot commentedJun 9, 2025
edited by unfurl-linksbot
Loading

📣 Hey @@MartinGC94, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗https://aka.ms/PSRepoFeedback

@MartinGC94MartinGC94 deleted the fixfilequote branchJune 9, 2025 06:45
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@iSazonoviSazonoviSazonov approved these changes

Assignees

@iSazonoviSazonov

Labels

CL-GeneralIndicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Tab completion does not quote Unicode filenames with full-width characters, leading to incorrect command parsing

2 participants

@MartinGC94@iSazonov

[8]ページ先頭

©2009-2025 Movatter.jp