Hacker News new | ask | show | jobs
by moonboots 5175 days ago
This script inserts terminal escape sequences into text. These sequences are just text that the terminal interpret as color transitions.

Ascii.io transforms these terminal escape sequences into html/css, so Grc should work fine with it.

1 comments

This script inserts terminal escape sequences into text.

I understand that part. But there's a screenshot where a "ping" is being done at a normal looking terminal and it just works without being explicitly piped through a program that does the above. What's the mechanism for piping all the terminal output through another process?

The initial grc command aliases commands like 'ping' to a modified command that processes the output[1].

[1] https://github.com/mxcl/homebrew/blob/7bbe7e9311ce95a141bf5f...

Ahh, aliases. Thanks :-) Makes sense. I was probably dreaming of a world where it'd pick up an IP address by regex in any terminal output.
Those are supplied if you source the aliases that ship with the Homebrew formula: https://github.com/mxcl/homebrew/blob/7bbe7e9311ce95a141bf5f...