5 ms·
Windows really needs to ditch CRLF and just use LF, and switch from backslashes to forward slashes. Or better yet, just switch everything to full POSIX. In pow
by jakegmaths 4mo ago
Windows really needs to ditch CRLF and just use LF, and switch from backslashes to forward slashes. Or better yet, just switch everything to full POSIX.
In powershell everything is much better than cmd, but it's just not enough.
WSL is generally great, but there are annoying downsides. I often get "catastrophic" crashes and the zone identifier files drive me nuts. Plus it takes so much longer to start VSCode when connecting with WSL, and now you've got two file systems. WSL1 was in many ways better than WSL2 for these reasons.
- aniceperson 4mo agothe two filesystems can be a super power... i seamlessly use the same driver between wsl2 and my dual booted opensuse.
- thewebguyd 4mo agoYeah I don't mind/like the two file systems. Looks like MS is taking it further too they also announced WSL Containers & API.
- weregiraffe 4mo ago>Windows really needs to ditch CRLF... Windows needs to ditch itself.
- saidnooneever 4mo agohonestly your point is a bit weird. powershell is good. its much better than unix's everything piped is Text idea. godawfull that. outputs being objects is a really solid take. WSL is trash. besides that, lf vs. crlf is silly as you mention but crlf is more logical considering what its implementing. that being said the notion of these control chars is already based on outdated and limited ideas. if you want a consistent system to do things with dont pick a system which tries to be two systems. Linux has wine. Windows has WSL. I'd recommend BSD. any flavor will do. might take some adjustments but you will have a more 'rational' system if that is what you desire. (otherwise, embrace the madness!)
- thewebguyd 4mo ago> outputs being objects is a really solid take. Glad I'm not alone here ha! Being able to go someoutput | Format-Table | Select ColumnName,ColumnName,CloumnName is great. Beats memorizing the output format of any specific command and trying to wrangle it with awk.
- d3Xt3r 4mo agoYou can skip the `| Select` btw. Just do `someoutput | ft ColumnName,ColumnName,CloumnName`
- ACS_Solver 4mo agoI'm a big Linux advocate with limited experience on modern versions of Windows, but PowerShell objects are great. So is the Unix way of doing text. I think the strengths of each approach are in different use cases. Unix style is better for interactive usage because it's fast, I can type df -h | grep /home very quickly. Object output is better for scripts that can, thanks to objects, store and operate on sensible data while Bash scripts do a lot of ad-hoc data extraction/reformatting with string expansion, awk and whatever else to get data to the next step in the script.
- pjmlp 4mo agoInspired by the ways of Xerox, Genera and ETHZ. It can be verbose, but the object approach, and having .NET, DLLs and COM as first class primitives is quite flexible. Naturally you can have a similar experience on UNIX, e.g. fish, but very few do it.
- throwaway613746 4mo ago[dead]
- cardboard9926 4mo agoDon't think this will ever happen, especially since this is Microsoft you are talking about [0] [0] https://www.youtube.com/watch?v=bC6tngl0PTI https://www.youtube.com/watch?v=bC6tngl0PTI
- rfgplk 4mo ago> Or better yet, just switch everything to full POSIX. Really not possible as most of POSIX semantics arise naturally from the kernel (or are enforced/executed at the kernel level). Windows technically provides some of them (or semantic equivalents) so you could make something work, but in order to do a full port you'd need to strip out too many concepts for it to be worthwhile. For instance the idea that "everything is a file" or the single root filesystem layout (which iirc is segmented deeply at the kernel level).
- hnlmorg 4mo ago> Really not possible as most of POSIX semantics arise naturally from the kernel (or are enforced/executed at the kernel level). The kernels undoubtedly take different approaches. But there's nothing in NT that strictly prohibits POSIX compatibility layers. As we see with the many compatibility layers that have existed for Windows over the years. > For instance the idea that "everything is a file" POSIX doesn't have a concept of "everything is a file". That's Plan 9. UNIX and POSIX actually made numerous concessions here and there are plenty of constructs that are not exposed as a file. Windows does already abstract a few primitives as files too. In fact even DOS has the concept of device files, though in typical Microsoft fashion, it's implementation was a clusterfuck that took MS 40 years to fix. > or the single root filesystem layout (which iirc is segmented deeply at the kernel level). NT uses an object system for filesystem objects, but it still has a root. As you can see in the WinObj (eg screenshot below) https://learn.microsoft.com/en-us/sysinternals/downloads/media/winobj/winobj.png https://learn.microsoft.com/en-us/sysinternals/downloads/med... The C:\ convention is really more there for compatibility with DOS-lineage software but the underlying filesystem APIs work fine with NT objects. For example, C:\foo.txt might be equivalent to \Device\HarddiskVolume3\foo.txt In this regard, it's similar to how POSIX has a database of inodes and the filesystem hierarchy is actually just an abstraction that sits on top of that
- Grom_PE 4mo agoOn Windows, I've mostly avoided CRLF by configuring text editors and git to use LF, and writing text files in binary mode. The only places that still forced CRLF were batch files and clipboard.
- wnevets 4mo ago> I've mostly avoided CRLF by configuring text editors and git to use LF, That has been my experience as well. I can't remember the last time I had an issue related to CRLF.
- pipes 4mo agoYesterday for me was the last time. Visual studio 2026 default to crlf I think maybe and I have autoctlf in git turned off. I should probably turn that back on.
- Measter 4mo agoThe only times I can remember having line-ending issues is using GNU's tools on Linux. Every Windows tool I can remember using accepts both CRLF and LF.
- layer8 4mo ago
- EvanAnderson 4mo ago> ... Or better yet, just switch everything to full POSIX. Interix[0] did a pretty good job of this, but MSFT killed it. I was compiling GNU tools w/ GCC and running bash under Interix back in in 2000 under Windows 2000. It was grand. [0] https://en.wikipedia.org/wiki/Interix https://en.wikipedia.org/wiki/Interix
- avidphantasm 4mo agoNo, they need to ditch drive letters first. The NT kernel and NTFS don't even require them (I used to mount disks without drive letters back in the NT 4 era). They just don't care enough to get rid of this annoyance.
- noselasd 4mo agousers , especially non-technical, find it highly useful in my experience. Is it a net positive to get rid of them, or will it largely only make developers happier ?
- avidphantasm 4mo agoIt’s arcane and technical for no reason. /Users/ME/Documents, /Media/MyThumbDrive/…, etc. are much clearer and less confusing than C:\…
- thewebguyd 4mo agoAt the very least, drive letters do make SMB shares a bit simpler for the non technical folks. T:\MyData is easier for them than \\0010-somehost-win.site1.mycorp.loca\Share01\MyData\ I used to support a group of completely tech illiterate users in construction & manufacturing. Them figuring out T:\ was hard enough, ask them to type in a UNC path into the address bar in explorer and you get "Wtf is file explorer? Wtf is an address bar? Where is the backslash key??"
- piperswe 4mo agoThen in this hypothetical world you could mount \\0010-somehost.win.site1.mycorp.local\Share01 to /Share01 rather than T:
- avidphantasm 4mo agoOr just use sane names like \\MyDivision\Share01\MyData and mount that to \Network\Share01 or some such.
- 4mo ago
- pjmlp 4mo agoNo worries, eventually Xenix will make a comeback. You cannot ditch CRLF, Microsoft isn't Apple. Windows accepts backslashes and forward slashes, only old applications that manually search for one of them get it wrong.
- fg137 4mo agoThey might as well create a new OS with a different name, because none of the existing applications will work, and no enterprise customer will use it.
- chasil 4mo agoWindows is also a rare bird in UTF-16. "UTF-16 is used by the Windows API, and by many programming environments such as Java and Qt. The variable-length character of UTF-16, combined with the fact that most characters are not variable-length (so variable length is rarely tested), has led to many bugs in software, including in Windows itself. "UTF-16 is the only encoding (still) allowed on the web that is incompatible with 8-bit ASCII. It has never gained popularity on the web, where it is declared by under 0.004% of public web pages (and even then, the web pages are most likely also using UTF-8). UTF-8, by comparison, gained dominance years ago and accounted for 99% of all web pages by 2025." https://en.wikipedia.org/wiki/UTF-16 https://en.wikipedia.org/wiki/UTF-16
- Dwedit 4mo agoUTF-16 is also used by C#, Java, and JavaScript. Since JavaScript is so widely adopted, I wouldn't call it a rare bird. Not necessarily used when reading or writing files, but it's what's used internally for the strings. As a result, your strings use UTF-16 surrogate pairs to represent characters outside of the basic multilingual plane (such as Emoji).
- zahllos 4mo agoAdditional Detail: it is specifically utf-16 little endian when a byte order mark is not used, which is the opposite of the recommended choice of big endian in the RFC. Worse are the byte order marks required to support both endians that end up in files.
- layer8 4mo agoThe development of Windows NT based on UCS-2 precedes the RFC by roughly a decade, and little-endian was the natural choice for the Intel PC platform. Obviously the endianness had to remain the same when UCS-2 was extended to support UTF-16.
- zahllos 4mo agoAlso true. The BOMs though are annoying.
- 0cf8612b2e1e 4mo agoMost (everything?) on Windows actually works with forward slashes. However, much of the tooling will overwrite your version with a backslash wherever it can.
- badc0ffee 4mo agoAt which layer? dir /w, for example, is never going to list the contents of \w.
- deleted 4mo ago[deleted]
- recursive 4mo agoUse powershell. Get-ChildItem /w
- jimjimjim 4mo agoToo many keystrokes, people won't use it.
- yyyk 4mo agogci /w than?
- recursive 4mo agols /w also works
- ranger_danger 4mo agohttps://learn.microsoft.com/en-us/powershell/module/microsoft.graph.identity.signins/remove-mgidentityauthenticationeventflowasongraphapretributecollectionexternaluserselfservicesignupattributeidentityuserflowattributebyref?view=graph-powershell-1.0 https://learn.microsoft.com/en-us/powershell/module/microsof...
- 4mo ago
- forrestthewoods 4mo agoI have absolutely zero sympathy for any tool that is incapable of handling \r\n and only works with \n. Literally absolutely no sympathy. All software accumulates warts over time. Linux is overflowing with horrible warts and tech debt. As is any software that has successfully served customers for decades. But multiple line endings are quite possibly the easiest most trivial thing to support and there is absolutely no negative cost of any kind in doing so. Linux ecosystem chooses to be stubborn and provide a strictly worse user experience out of pure spite and for zero user benefit. It’s very irritating.
- yjftsjthsd-h 4mo ago> But line endings are quite possibly the easiest most trivial thing to support and there is absolutely no negative cost of any kind in doing so. Linux ecosystem chooses to be stubborn and provide a strictly worse user experience out of pure spite and for zero user benefit. It’s very irritating. The Linux ecosystem handles it fine (by using a single standard). Windows doesn't. That's its problem.
- justsomehnguy 4mo ago> The Windows ecosystem handles it fine (by using a single standard). Linux doesn't. That's its problem. It's always funny to see how the fanbois treat their way as the one and only 'True Way'.
- yjftsjthsd-h 4mo agoI didn't say it was the one and only True Way. My intended meaning - which I admit I may have poorly conveyed - is that tools from the unix ecosystem are intended to work on unix conventions, and do, and that works. Windows has different standards, which is also fine, but it follows that you shouldn't expect unix tools to follow Windows standards even if you make them run on Windows. This is like getting Windows software to run under WINE and then complaining that it doesn't use /n newlines and that it should change to accommodate Linux (or whatever). No, a Windows program will follow Windows standards even when made to run on a unix-like. And in the same way, unix-family software is going to follow unix standards even on Windows.
- Night_Thastus 4mo ago"Windows really needs to ditch CRLF and just use LF, and switch from backslashes to forward slashes." Hahahahaha. That's hillarious. Oh god, you're serious? Do you have any idea how much of Windows, and user software would break? Any idea at all? You really want MS, who has built backwards compatibility as a core feature of Windows, to break countless thousands of pieces of software that run on it? I'm sure there's some idealized fantasy in which that change gets wrapped in a neat little abstraction that prevents anything from breaking. I promise you, there is no way of encapsulating or abstracting that change that works for everyone. If I could wave a magic wand and make it so without breaking it, I would. But it's a fantasy.
- hnlmorg 4mo ago> break countless thousands of pieces of software I'd estimate millions
- sometimelurker 4mo agomaybe windows should actually just become linux
- alok-g 4mo ago>> Windows really needs to ditch CRLF and just use LF, and switch from backslashes to forward slashes. {To the extent such stuff is pragmatic:} I think we should switch to Pascal-style strings everywhere, and then have no need for having special-purpose characters like path separators (a path now being a list of strings).
- pjmlp 4mo agoWindows has been doing for quite a while, that is how COM strings work.