Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Fix 95% of ANSI / emoji rendering glitches + CONTEST: fastest cat.exe

Jul
534
10
ANSI rendering is HORRIBLY inconsistent.

Easiest way to fix it? Pipe through cat.exe

Say you have this command, but the rendering glitches out 1 out of 5 times:
Code:
echo y | a.bat |:u8 a_python_script.py

rem (Try to use |:u8 pipe for anything with emoji)
rem (But not neessary when just echo'ing a 'y')


Simple fix: You just pipe it through the unix 'cat' command. Which for me was cygwin's cat.exe.

Code:
(echo y | a.bat |:u8 a_python_script.py) |:u8 cat.exe
rem the parens can be quite important

On super rare occasion with unnecessarily nested things, it may be necessary to do this twice.

Anyway — This slows things down.

So I gathered several different versions of cat.exe (64-bit, 32-bit, cygwin, non-cygwin, maybe even a 16-bit one) and did performance tests on them.

Big difference on some.

The one that worked fastest for me was this one:

Code:
cat (GNU coreutils) 8.32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>

Which as of this post is here, but may be replaced with a faster one if i find one:



A CONTEST:

Find a cat.exe that works even faster than the current winner I've selected here.
 
Last edited:
A CONTEST:

Find a cat.exe that works even faster than the current winner I've selected here.
 
Why didn't you just tell us which cat it was? It's GNU cat, 64-bit, version 8.32. It's the same one I use. I got mine with an "Octave" (MatLab clone) installation. I have these in d:\gnu. I think there are more that I didn't copy.

Code:
awk.exe cat.exe cksum.exe cmp.exe cp.exe cut.exe diff.exe diff3.exe du.exe expand.exe factor.exe gawk-5.3.0.exe gawk.exe grep.exe
gzip.exe head.exe ls.exe perl.exe perl5.38.2.exe sed.exe sort.exe stat.exe tac.exe tail.exe tee.exe tr.exe uniq.exe wc.exe which.exe

I use cmp, cut, grep, sed, sort, uniq, and wc a lot; the others seldom (or never).

How did you do your speed testing?
 
I use cmp, cut, grep, sed, sort, uniq, and wc a lot; the others seldom (or never).

How did you do your speed testing?

Good call!

I don't remember, but i think i just piped a buncha stuff through each one and compared the timing results. not sure how else really.
 
Back
Top