Use forward slashes by default in Windows
See original GitHub issueSummary of the new feature/enhancement
PowerShell aims to be cross-platform, but I have been having many issues operating on paths across both Windows and Linux. I understand the need to support \
in Windows for the foreseeable future, but I would at least like the default path character to be the same on both Windows and *nix, presumably by setting the default path delimiter to /
. The current alternative is forcing users to normalize paths themselves with -replace "\\", "/"
in their paths.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:53
- Comments:96 (62 by maintainers)
Top Results From Across the Web
Is there a consistent way to make Windows use forward ...
I'd like Windows to use forward slashes like in UNIX instead of back slashes in the file paths. I have a several thousands...
Read more >Using Forward or Backward Slashes Under Windows
You can use forward slashes ( / ) instead of backward slashes ( \ ) on Windows (as is the case with Linux®...
Read more >Use forward slashes by default for includes
By default, Visual Studio uses backslashes when autocompleting C++ #includes. This makes no sense, and literally no one outside of ...
Read more >Why does Windows use backslashes for paths and Unix ...
The underlying Windows API can accept either the backslash or slash to separate directory and file components of a path, but the Microsoft...
Read more >Why Windows Uses Backslashes and Everything Else ...
Even if you're running a web server or FTP server on a Windows machine, they'll use forward slashes because that's what the protocol...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think it would be nice if path completion used the path separator that appears explicitly in the completion text, and if there is none, then default to the platform native separator.
So on Windows,
c:\w
completes toc:\Windows\
andc:/w
completes to ‘c:/Windows/’.I think this would cover a majority of the annoyances without requiring a configuration option, and is actually preferable because you occasionally might need the other form for whatever reason.
Who says? That’s absolutely not true. An open issue is open, and a closed issue is closed. Those two distinctions have very clear meaning. I only look at closed issues if they are my own and I want to go back to check something. On a rare occasion I may go searching closed issues for discussions on a certain topic. But 90% or more of my time in issues is in open issues, as it should be. The only thing blurring the line between the two and making open issues lose their meaning is summarily closing them before they are resolved, like you have done with this issue.
Based on this approach to managing issues, you’re forcing people to lose the distinction between open and closed, such that they have to search all issues rather than focus on the open issues, which means checking the 2K open issues plus the 4K closed issues for discussions relevant to them instead of just focusing on the open issues. That is a broken, flawed issue management strategy.
That is ridiculous. The discussion is focused on dealing with Windows having a backslash as the default when you are writing scripts for cross platform. It has remained focused on that topic. You’re trying to make it sound like it isn’t focused at all.
@iSazonov, I agree that there are too many open issues; however, the fact that there are too many open issues does not mean we should be dismissive and shut conversation down prematurely on new issues. We must continue to encourage feedback and be open to discussion about PowerShell in open issues, and only close them once they are truly resolved. The volume of open issues must be dealt with differently.