Open 500-internal-server-error opened 5 months ago
GNU cat
always using LF
is a bug by definition. POSIX allows systems to define their own <newline>
which is CRLF
on Windows; but somehow cat
accepts text files that end in incomplete lines more easily than files and environments that aren't exclusively \n
.
That said, configurable behavior for bat output would be bliss
In the meantime I learned that the LF
and ^D
behavior of cat
on Windows is entirely due to Cygwin's cygwin1.dll
and MSYS2's msys-2.0.dll
, deep in the Unix environment emulation dark magic. So I don't think it can be a "userland" config without essentially recreating Cygwin somewhere down the line, probably inside Rust.
One can certainly dream though :)
The app description says "A cat(1) clone", so I expected it to behave like
cat
more :)GNU coreutils
cat
, whether natively on Linux or through emulation such as Cygwin/MSYS2 on Windows, always usesLF
characters, and when doingcat | hexdump -Cv
, it waits for^D
before terminating.On Linux,
bat
behaves as I expect, usingLF
and waiting for^D
whencat
ing tohexdump
. On Windows, however, it usesCRLF
and waits for^Z
instead.I doubt there is a setting somewhere to change this, but it would be great if I could be pointed to where to patch my local install of
bat
to behave more like GNU coreutilscat
on Windows.Thanks in advance.