busyloop / lolcat Goto Github PK
View Code? Open in Web Editor NEWRainbows and unicorns!
License: BSD 3-Clause "New" or "Revised" License
Rainbows and unicorns!
License: BSD 3-Clause "New" or "Revised" License
The short version: I want to have everything put out by mutt
passed through lolcat
while maintaining normal functionality.
Type this into your terminal:
while true; do echo -n $RANDOM | cat; done
The output is as expected, now type this into your terminal
while true; do echo -n $RANDOM | lolcat; done
As you can see lolcat is putting everything on a new line
Hi,
Some shells/TTY's doesn't support all the colors (only 16 base colors for instance) ,
So I was wondering if a flag to set that terminal type / limit the max color number is an option?
Thanks!
Does not fully support utf-8 encoded files (characters). Tested with this file http://pastebin.com/MVp3Dz5x and got the following error:
> cat utf.txt | lolcat
/Library/Ruby/Gems/2.0.0/gems/lolcat-42.1.0/lib/lolcat/lol.rb:45:in `gsub!': invalid byte sequence in UTF-8 (ArgumentError)
from /Library/Ruby/Gems/2.0.0/gems/lolcat-42.1.0/lib/lolcat/lol.rb:45:in `println'
from /Library/Ruby/Gems/2.0.0/gems/lolcat-42.1.0/lib/lolcat/lol.rb:36:in `block in cat'
from /Library/Ruby/Gems/2.0.0/gems/lolcat-42.1.0/lib/lolcat/lol.rb:34:in `each_line'
from /Library/Ruby/Gems/2.0.0/gems/lolcat-42.1.0/lib/lolcat/lol.rb:34:in `each'
from /Library/Ruby/Gems/2.0.0/gems/lolcat-42.1.0/lib/lolcat/lol.rb:34:in `cat'
from /Library/Ruby/Gems/2.0.0/gems/lolcat-42.1.0/lib/lolcat/cat.rb:113:in `block in cat!'
from /Library/Ruby/Gems/2.0.0/gems/lolcat-42.1.0/lib/lolcat/cat.rb:107:in `each'
from /Library/Ruby/Gems/2.0.0/gems/lolcat-42.1.0/lib/lolcat/cat.rb:107:in `cat!'
from /Library/Ruby/Gems/2.0.0/gems/lolcat-42.1.0/bin/lolcat:25:in `<top (required)>'
from /usr/bin/lolcat:23:in `load'
from /usr/bin/lolcat:23:in `<main>'
Please provide a symlink. nyancat can has more rainbow.
This is too awesome. Unfortunately when I try to run it without sudo I get the following error:
kevinburke$ fortune | lolcat
/usr/bin/lolcat:19:in `load': no such file to load -- /Library/Ruby/Gems/1.8/gems/lolcat-42.0.21/bin/lolcat (LoadError)
Running fortune | sudo lolcat works but is really annoying. What permissions/owners do I have to change to get it to run?
https://github.com/jaseg/lolcat
...it's much faster because it is avoiding unnecessary escape sequences and C. Also, it has zero dependencies and as such is pretty easy to deploy (for reference, try installing busyloop/lolcat
on arch ;).
When the incoming text contains color codes itself lolcat will treat them like any other text. I think it should strip them instead.
Example: http://d.pr/uamE
I love lolcat but it can sometimes be a hard sell convincing clients to install it into their production servers to render something like the MOTD dynamically instead of having a static file in /etc/motd.
I tried to pipe lolcat's output to a file/less/more/expect but I've been unsuccessful so far.
I would love to know if there is a tool already for this. Otherwise, it be great we could implement a flag like --export-to-file option where all the special color characters are used.
/usr/bin/lolcat:19:in `load': no such file to load -- /Library/Ruby/Gems/1.8/gems/lolcat-42.0.21/bin/lolcat (LoadError)
from /usr/bin/lolcat:19
literally every day.
please fix it.
I tend to run my terminals on a white background. The bright, pastel colors make some bits hard to read. How about a version optimized for white/bright backgrounds?
Only show this in WSL:
/var/lib/gems/2.3.0/gems/lolcat-99.9.11/lib/lolcat/lol.rb:63: warning: Insecure world writable dir /mnt/c in PATH, mode 040777
Do I need to change the ANSI colors of Terminal? What are those colors? The colors I get are much ugly… also, is that Inconsolata Bold? Can't find a bold version anywhere…
What about adding:
$ cat /dev/urandom | base64 -b 80 | lolcat
as an example ? The above command just made my day :)
Not a big deal, obviously, but it'd be nice if this project had a man page. Debian has written one for it, but distributions that pull directly from source (like Arch) don't have that because it isn't actually part of the project release files.
Hey,
currently it is impossible to package lolcat properly on a distribution level, as it has a hard dependency to paint 0.8.6 and trollop 1.16.2.
Please don't enforce specific trollop and paint version, this is needed as its not possible to ship lolcat on a distribution level. To be able to ship lolcat as a distribution package, it needs to be compatible with paint 1.0.0 and trollop 2.1.2.
Can you please adjust the gemspec accordingly? (Not sure if there is any code change required or both libs remained API compatible)
Once this is resolved I plan to package your software into the repositories 😄
With cat
you can do this to get boring infinite white text:
cat /dev/random | base64 | cat
However, when doing the same with lolcat
, it never shows any awesome rainbow colored output:
cat /dev/random | base64 | lolcat
Do you think it would be possible for you to create a formula like explained here: https://github.com/Homebrew/brew/blob/master/docs/Formula-Cookbook.md
If not. Do you give your permission that someone else might create a formula on your behalf?
Perhaps there is something set strangely in my OSX environment, but my colors do not blend as nicely as the example screenshot.
https://skitch.com/kevinelliott/egsdr/1-bash
The example screenshot at https://github.com/busyloop/lolcat shows intermediary colors, where mine shows only major color jumps.
Test
echo -e "\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88" | lolcat
Expected result
███████
Rainbow ride
Actual result is in color
���������������������
This lets me alias lolcat to cat, but turn of the magic when it would interfere with how I want to consume the output. More general case of #6.
THIS IS A SHOWSTOPPER ISSUE PLEZ FIX
Command cat /dev/urandom | lolcat
constantly gives me following error:
Traceback (most recent call last):
10: from /usr/bin/lolcat:23:in `<main>'
9: from /usr/bin/lolcat:23:in `load'
8: from /usr/lib/ruby/gems/2.5.0/gems/lolcat-90.8.8/bin/lolcat:32:in `<top (required)>'
7: from /usr/lib/ruby/gems/2.5.0/gems/lolcat-90.8.8/lib/lolcat/cat.rb:102:in cat!'
6: from /usr/lib/ruby/gems/2.5.0/gems/lolcat-90.8.8/lib/lolcat/cat.rb:102:in `each'
5: from /usr/lib/ruby/gems/2.5.0/gems/lolcat-90.8.8/lib/lolcat/cat.rb:108:in `block in cat!'
4: from /usr/lib/ruby/gems/2.5.0/gems/lolcat-90.8.8/lib/lolcat/lol.rb:42:in `cat'
3: from /usr/lib/ruby/gems/2.5.0/gems/lolcat-90.8.8/lib/lolcat/lol.rb:42:in `each'
2: from /usr/lib/ruby/gems/2.5.0/gems/lolcat-90.8.8/lib/lolcat/lol.rb:44:in `block in cat'
1: from /usr/lib/ruby/gems/2.5.0/gems/lolcat-90.8.8/lib/lolcat/lol.rb:53:in `println'
/usr/lib/ruby/gems/2.5.0/gems/lolcat-90.8.8/lib/lolcat/lol.rb:53:in `gsub!': invalid byte sequence in UTF-8 (ArgumentError)
It completely blocks my work with the program, what are chances to fix the problem?
It appears lolcat
only works on utf-8-encoded files. E.g. running lolcat /bin/cat
results in
/Library/Ruby/Gems/2.0.0/gems/lolcat-42.24.0/lib/lolcat/lol.rb:53:in `gsub!': invalid byte sequence in UTF-8 (ArgumentError)
This problem was posted here before, but I am not sure how this does not relate to lolcat. Is it intended to only work with utf-8?
The installation fails when trying to symlink to /usr/bin
.
Fix: change to /usr/local/bin
When using lolcat via homebrew (MacOS), cowsay doesn't seem to work. I am using it in this context:
cowsay "Hi" | lolcat
Is that right?
Does lolcat support Unicode? I get question marks instead of the proper characters:
Example screenshot
Regression after #68 in lolcat 99.9.10.
❯ brew install lolcat
🍺 /usr/local/Cellar/lolcat/99.9.10: 187 files, 413.7KB
❯ ponysay -f crakle "i'm a pony." | /usr/local/bin/lolcat
lolcat-99.9.10/lib/lolcat/lol.rb:69:in `sub!': invalid byte sequence in UTF-8 (ArgumentError)
from lib/lolcat/lol.rb:69:in `println'
from lib/lolcat/lol.rb:57:in `block in cat'
from lib/lolcat/lol.rb:55:in `each'
from lib/lolcat/lol.rb:55:in `cat'
from lib/lolcat/cat.rb:108:in `block in cat!'
from lib/lolcat/cat.rb:102:in `each'
from lib/lolcat/cat.rb:102:in `cat!'
from bin/lolcat:32:in `<top (required)>'
My pony no longer talks to me...
There's less rainbow in my forecast...
❯ sw_vers
ProductName: Mac OS X
ProductVersion: 10.11.6
❯ locale
LANG="en_CA.UTF-8"
LC_COLLATE="en_CA.UTF-8"
LC_CTYPE="en_CA.UTF-8"
LC_MESSAGES="en_CA.UTF-8"
LC_MONETARY="en_CA.UTF-8"
LC_NUMERIC="en_CA.UTF-8"
LC_TIME="en_CA.UTF-8"
LC_ALL=
When coloring terminal output that uses control characters, the control characters are interrupted by the color codes. The proper behavior would be that the ANSI control code is not colored, and lolcat skips to the next printable character.
A good test case for this behavior is using lolcat with sl (steam locomotive).
Try sl | lolcat
in your preferred shell.
Bonus Points:
If the coloring was seeded based on character position, instead of incremental color changes, (ie. doing coloring statelessly) then coloring could be consistent within a single execution of the program. It would of course be ideal to have the coloring randomly seeded per execution so the effect continues to stay novel.
Seems like lolcat thinks a tab is just one character, but it is 8!!! The rainbow is misaligned! THE HORROR@.@
nyancat would be more accurate, I think.
if you alias cat to lolcat then try to pipe into other tools (grep, less, ...) the lolcat barfs all over you grep.
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /usr/local/lib//libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Abort trap: 6
dyld: Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /usr/local/lib//libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Abort trap: 6```
Howdy, Sorry to bother you with this, but WTFPL is not a real usable license, please see:
https://en.wikipedia.org/w/index.php?title=WTFPL&oldid=712812819#Effectiveness_as_license_or_waiver
https://en.wikipedia.org/w/index.php?title=WTFPL&oldid=712812819#Characteristics
I realize you might find the legalese distinction silly, but lawyers in big companies tend not to, and in ours are banning all WTFPL software since the license grant is insufficient and unlikely to hold up in court as explained in the wikipedia article.
While I'm not exactly worried about getting sued over lolcat, sadly when we manage tens of thousands of users and tens of thousands of software packages for our users, we don't really have time to make a legal risk assessment for each individual package with a weird license.
Since your intent was likely to give the most free license you could, would you consider relicensing to MIT or BSD license?
Thank you on behalf of some of our users who like your software and us who won't have to pull your package, if you're willing to do this.
Test Case:
curl https://en.wikipedia.org/wiki/Lolcat 2>&1 | lolcat
Crashes with:
/usr/lib/ruby/gems/2.0.0/gems/lolcat-42.0.99/lib/lolcat/lol.rb:45:in gsub!': invalid byte sequence in US-ASCII (ArgumentError) from /usr/lib/ruby/gems/2.0.0/gems/lolcat-42.0.99/lib/lolcat/lol.rb:45:in
println'
from /usr/lib/ruby/gems/2.0.0/gems/lolcat-42.0.99/lib/lolcat/lol.rb:36:in block in cat' from /usr/lib/ruby/gems/2.0.0/gems/lolcat-42.0.99/lib/lolcat/lol.rb:34:in
each_line'
from /usr/lib/ruby/gems/2.0.0/gems/lolcat-42.0.99/lib/lolcat/lol.rb:34:in each' from /usr/lib/ruby/gems/2.0.0/gems/lolcat-42.0.99/lib/lolcat/lol.rb:34:in
cat'
from /usr/lib/ruby/gems/2.0.0/gems/lolcat-42.0.99/lib/lolcat/cat.rb:113:in block in cat!' from /usr/lib/ruby/gems/2.0.0/gems/lolcat-42.0.99/lib/lolcat/cat.rb:107:in
each'
from /usr/lib/ruby/gems/2.0.0/gems/lolcat-42.0.99/lib/lolcat/cat.rb:107:in cat!' from /usr/lib/ruby/gems/2.0.0/gems/lolcat-42.0.99/bin/lolcat:25:in
<top (required)>'
from /usr/bin/lolcat:23:in load' from /usr/bin/lolcat:23:in
in my mac, when I exec ps aux | lolcat
, and I got
_coreaudiod 183 1.4 0.1 2476256 6032 ?? Ss 三01下午 6:13.47 /usr/sbin/coreaudiod
/Users/weiwei/.rvm/gems/ruby-1.9.3-p194/gems/lolcat-42.0.99/lib/lolcat/lol.rb:45:in `gsub!': invalid byte sequence in UTF-8 (ArgumentError)
from /Users/weiwei/.rvm/gems/ruby-1.9.3-p194/gems/lolcat-42.0.99/lib/lolcat/lol.rb:45:in `println'
from /Users/weiwei/.rvm/gems/ruby-1.9.3-p194/gems/lolcat-42.0.99/lib/lolcat/lol.rb:36:in `block in cat'
from /Users/weiwei/.rvm/gems/ruby-1.9.3-p194/gems/lolcat-42.0.99/lib/lolcat/lol.rb:34:in `each_line'
from /Users/weiwei/.rvm/gems/ruby-1.9.3-p194/gems/lolcat-42.0.99/lib/lolcat/lol.rb:34:in `each'
from /Users/weiwei/.rvm/gems/ruby-1.9.3-p194/gems/lolcat-42.0.99/lib/lolcat/lol.rb:34:in `cat'
from /Users/weiwei/.rvm/gems/ruby-1.9.3-p194/gems/lolcat-42.0.99/lib/lolcat/cat.rb:113:in `block in cat!'
from /Users/weiwei/.rvm/gems/ruby-1.9.3-p194/gems/lolcat-42.0.99/lib/lolcat/cat.rb:107:in `each'
from /Users/weiwei/.rvm/gems/ruby-1.9.3-p194/gems/lolcat-42.0.99/lib/lolcat/cat.rb:107:in `cat!'
from /Users/weiwei/.rvm/gems/ruby-1.9.3-p194/gems/lolcat-42.0.99/bin/lolcat:25:in `<top (required)>'
from /Users/weiwei/.rvm/gems/ruby-1.9.3-p194/bin/lolcat:19:in `load'
from /Users/weiwei/.rvm/gems/ruby-1.9.3-p194/bin/lolcat:19:in `<main>'
from /Users/weiwei/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/weiwei/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
Please help.
Lolcat always used 256 colors for me, until I tried it in a screen session. I added a bunch of stuff to my .screenrc and it's still not working. This is my screenrc:
defscrollback 5000
termcapinfo xterm* ti@:te@
altscreen
attrcolor b ".I"
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
defbce "on"
term screen-256color-bce
The last 4 lines is what I did to try to get lolcat to use 256 colors.
It would be nice if there were an option to use the return code of the previous program, so that (for example) really-long-build | lolcat
would return a failure code if the build failed.
The really-long-build
is out of our hands. We've actually found that piping the output to lolcat makes the errors stand out more (since stderr is not recolored) 😄
I am afraid our servers will not be running lolcat in production soon for its abysmal speed.
But that give us more time to admire the rainbows while parsing logs... So maybe that's intended
I pipe a few scripts through lolcat because rainbow output is awesome. However, I noticed that when a script includes an emoji in its output (such as 🍺 from certain homebrew
output lines), lolcat fails at the emoji and the remaining output is dropped.
For reference, I'm on OSX 10.13.4 and installed lolcat using homebrew
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.