From: Theodore Tso Date: Tue, 11 Aug 2026 05:34:34 GMT Subject: Re: AI Textconv filter misconfiguration on Windows leads to silent corruption of diff output (ongoing investigation) Message-ID: In-Reply-To: On Tue, Aug 11, 2026 at 02:13:25AM -0500, Skybuck Flying wrote: > > So sed removes literal 'r' instead of carriage returns. It appears that on > Windows, the backslash in `\r` is not preserved through MSYS argument parsing, > effectively turning the expression into `s/r//`. The reason for this confusion is historical in nature and has to do with a fundamental difference between Windows and Unix. First, understand that Unix predates Windows, with Unix being first developed by AT&T Bell Labs in 1969, where as Windows dates from 1985, with DOS dating from 1981. Unix uses the forward slash ('/') as a path separator. However Windows and DOS uses the backwards slash ('\') as a path separator, since DOS 1.0 used forward slashes for command-line switches --- e.g., DIR/W. Since Windows and DOS uses backwards slash as a path separator, it can't be used as a quoting character, which is how Unix and Linux interprets the backlash character. Since MSYS (which is not developed by the Windows Git team; they just use it), attempts to be compatible with Unix / Linux, it uses backslash as quoting character. CMD.EXE and Powershell are Windows programs, which doesn't attempt to be Unix compatible. This is the nature of your confusion. It's unfortunate that you find this to be so irritating, but it's fundamentally because DOS/Windows chose, back in the early 1980's, to be incompatible with Unix. I personally find Windows conventions to be irritating, and my way of dealing with the problem is to avoid using Windows whenever possible. Instead, I use MacOS and Linux, which doesn't have these Windows compatibility problems. Feel free to not use git, and to avoid anything else which attempts to be compatible with Unix or Linux if that brings you peace. I certainly was much happier once I no longer had to deal with Windows as part of my day job. :-) Cheers, - Ted