Open hidden files in Open-EditorFile#2309
Open
andyleejordan wants to merge 1 commit into
Open
Conversation
On macOS and Linux, dot files are hidden, so `Get-ChildItem` skips them unless `-Force` is passed. This meant `psedit ~/.zshrc` (and similar) silently opened nothing, making the alias useless for exactly the kind of config files people most often want to jump into. Add `-Force` to the `Get-ChildItem` call in `Open-EditorFile` so hidden files resolve and open. The issue notes a wrinkle: with `-Force`, passing a *directory* would now also enumerate its hidden files. I think that's an acceptable trade-off for the common path-to-a-file case, and a draft for maintainer review either way. Fixes #1750. Drafted by Copilot (Claude Opus 4.8). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #1750 where Open-EditorFile (aliased as psedit) silently failed to open hidden files (dot files like ~/.zshrc) on macOS and Linux because Get-ChildItem skips hidden files by default.
Changes:
- Adds
-Forceto theGet-ChildItemcall inOpen-EditorFileso that hidden (dot) files are included in file resolution.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
@SeeminglyScience @JustinGrote ancient issue, one word fix, makes sense to me, no idea why we didn't do it sooner. |
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 #1750.
On macOS and Linux, dot files are hidden, so
Get-ChildItemskips them unless-Forceis passed — meaningpsedit ~/.zshrc(and similar) silently opened nothing. This adds-Forceto theGet-ChildItemcall inOpen-EditorFileso hidden files resolve and open.As the issue notes, this also means passing a directory will now enumerate its hidden files too. That is intentional:
pseditexposes no switch to include or exclude hidden files, so the only predictable default is to always include them. Treating the directory case as "always include hidden" keeps the behavior consistent rather than special-casing it.